Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / ImageListImage.cs / 1 / ImageListImage.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.Design { using System.ComponentModel; using System.Drawing.Design; using System.IO; using System.Drawing; using System.Drawing.Imaging; [Editor(typeof(System.Windows.Forms.Design.ImageListImageEditor), typeof(UITypeEditor))] internal class ImageListImage { public ImageListImage(Bitmap image) { Image = image; } public ImageListImage (Bitmap image, string name) { Image = image; Name = name; } private string _name = null; private Bitmap _image = null; public string Name { get { return (_name == null) ? "" : _name; } set { _name = value; } } [Browsable(false)] public Bitmap Image { get { return _image; } set { _image = value; } } // Add properties to make this object "look" like Image in the Collection editor public float HorizontalResolution { get { return _image.HorizontalResolution; } } public float VerticalResolution { get { return _image.VerticalResolution; } } public PixelFormat PixelFormat { get { return _image.PixelFormat; } } public ImageFormat RawFormat { get { return _image.RawFormat; } } public Size Size { get { return _image.Size; } } public SizeF PhysicalDimension { get { return _image.Size; } } public static ImageListImage ImageListImageFromStream(Stream stream, bool imageIsIcon) { if(imageIsIcon) { return new ImageListImage((new Icon(stream)).ToBitmap()); } else { return new ImageListImage((Bitmap)Bitmap.FromStream(stream)); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SchemaImporter.cs
- BamlBinaryReader.cs
- AssociativeAggregationOperator.cs
- CompareInfo.cs
- PerformanceCounterPermission.cs
- BamlLocalizableResourceKey.cs
- RightsManagementUser.cs
- DebugView.cs
- LambdaCompiler.cs
- GregorianCalendar.cs
- SafeLocalMemHandle.cs
- CustomErrorsSection.cs
- Quaternion.cs
- RoleGroupCollection.cs
- UnknownBitmapEncoder.cs
- ComponentCache.cs
- TrackBarRenderer.cs
- StringUtil.cs
- XpsException.cs
- SafeNativeMethods.cs
- XmlSchemaObject.cs
- WorkflowDefinitionDispenser.cs
- TextRenderer.cs
- AncillaryOps.cs
- _NtlmClient.cs
- ThicknessKeyFrameCollection.cs
- baseshape.cs
- WizardStepBase.cs
- InputBindingCollection.cs
- DataGridViewTextBoxColumn.cs
- LineInfo.cs
- Metafile.cs
- DiagnosticTrace.cs
- Listbox.cs
- LookupNode.cs
- TypeUtils.cs
- Rect3DConverter.cs
- ThreadNeutralSemaphore.cs
- IncrementalReadDecoders.cs
- MetadataSerializer.cs
- XmlDictionaryReader.cs
- ObjectReaderCompiler.cs
- webbrowsersite.cs
- NamespaceDecl.cs
- ScopeElementCollection.cs
- WebPartManager.cs
- ManipulationLogic.cs
- PeerContact.cs
- Geometry.cs
- SplayTreeNode.cs
- Accessible.cs
- JsonReaderWriterFactory.cs
- AsyncOperation.cs
- TimelineClockCollection.cs
- WeakKeyDictionary.cs
- DragCompletedEventArgs.cs
- DragDrop.cs
- XslAst.cs
- IPAddressCollection.cs
- ConnectionsZoneDesigner.cs
- PrintPreviewGraphics.cs
- StorageTypeMapping.cs
- Drawing.cs
- DataTableMappingCollection.cs
- MenuItemStyle.cs
- SystemEvents.cs
- storepermission.cs
- IndentTextWriter.cs
- SafeProcessHandle.cs
- ModelItemExtensions.cs
- WindowsToolbar.cs
- EnumBuilder.cs
- PaperSize.cs
- SurrogateSelector.cs
- InternalDispatchObject.cs
- unsafenativemethodstextservices.cs
- SmtpMail.cs
- SqlDependencyListener.cs
- DataServiceRequestException.cs
- ItemDragEvent.cs
- SamlAssertionDirectKeyIdentifierClause.cs
- NavigationPropertyEmitter.cs
- MailWebEventProvider.cs
- OrderByBuilder.cs
- Journaling.cs
- BaseTreeIterator.cs
- COM2PropertyPageUITypeConverter.cs
- XmlSecureResolver.cs
- GZipStream.cs
- SqlDataReader.cs
- NodeFunctions.cs
- XpsSerializationException.cs
- ContextInformation.cs
- ZipPackagePart.cs
- RecommendedAsConfigurableAttribute.cs
- IncrementalCompileAnalyzer.cs
- GeometryCombineModeValidation.cs
- FontStyleConverter.cs
- ApplicationServicesHostFactory.cs
- LinqDataSourceHelper.cs