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
- AssemblyContextControlItem.cs
- Crc32Helper.cs
- PartialClassGenerationTask.cs
- KeyMatchBuilder.cs
- SubMenuStyleCollection.cs
- XmlSchemaCollection.cs
- WebPartTracker.cs
- InputLanguageCollection.cs
- QilLoop.cs
- TextContainerHelper.cs
- BindingValueChangedEventArgs.cs
- SamlAction.cs
- Helpers.cs
- Attribute.cs
- ValidatingPropertiesEventArgs.cs
- CanonicalXml.cs
- LowerCaseStringConverter.cs
- XmlExtensionFunction.cs
- PropertyValueChangedEvent.cs
- SkewTransform.cs
- MsmqIntegrationChannelListener.cs
- TargetFrameworkUtil.cs
- GridEntryCollection.cs
- OledbConnectionStringbuilder.cs
- EqualityArray.cs
- ClassValidator.cs
- MemberDescriptor.cs
- ByteStream.cs
- ContentHostHelper.cs
- NativeMethods.cs
- Triplet.cs
- ConfigurationManagerHelperFactory.cs
- SpellerStatusTable.cs
- formatter.cs
- SQLInt64Storage.cs
- SoapFormatterSinks.cs
- RenamedEventArgs.cs
- DocumentSchemaValidator.cs
- DataColumnSelectionConverter.cs
- DateTimeOffset.cs
- ComponentResourceManager.cs
- Axis.cs
- DataGridViewCellMouseEventArgs.cs
- GradientStopCollection.cs
- TabControl.cs
- SynchronizedInputProviderWrapper.cs
- Monitor.cs
- WindowProviderWrapper.cs
- Console.cs
- FieldDescriptor.cs
- DependentList.cs
- FigureHelper.cs
- BinaryParser.cs
- RegexCompiler.cs
- FormatConvertedBitmap.cs
- TableDetailsCollection.cs
- XsdBuilder.cs
- MemoryMappedViewAccessor.cs
- ChannelServices.cs
- XmlSchemaAll.cs
- XmlElementAttribute.cs
- OleDbSchemaGuid.cs
- TablePattern.cs
- MediaPlayer.cs
- StreamingContext.cs
- SingleAnimationBase.cs
- TextDecorationCollectionConverter.cs
- AlphabeticalEnumConverter.cs
- DesignerForm.cs
- SubMenuStyle.cs
- ClientConfigPaths.cs
- PropertyReferenceExtension.cs
- WinEventHandler.cs
- SqlDataSourceSelectingEventArgs.cs
- OdbcEnvironment.cs
- CompositeScriptReference.cs
- TextParagraphView.cs
- WebConfigurationFileMap.cs
- XmlSchemaObjectCollection.cs
- TerminateDesigner.cs
- PtsPage.cs
- _Win32.cs
- DbConvert.cs
- SqlBuilder.cs
- VarInfo.cs
- Win32PrintDialog.cs
- SqlWebEventProvider.cs
- ExpressionBindingsDialog.cs
- LinqDataSourceContextEventArgs.cs
- DefaultPrintController.cs
- InstanceLockTracking.cs
- XmlValidatingReaderImpl.cs
- ExtendLockAsyncResult.cs
- StringFunctions.cs
- Int32KeyFrameCollection.cs
- XmlNullResolver.cs
- CheckBox.cs
- BinaryParser.cs
- CheckedListBox.cs
- TypeHelper.cs