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
- DesignerExtenders.cs
- ProcessHost.cs
- NetNamedPipeSecurityMode.cs
- FillErrorEventArgs.cs
- ETagAttribute.cs
- SqlPersistenceProviderFactory.cs
- FontFamilyValueSerializer.cs
- Italic.cs
- DrawingContextWalker.cs
- ToolboxBitmapAttribute.cs
- XsltException.cs
- RijndaelManaged.cs
- WhitespaceRuleLookup.cs
- ObjectItemCollection.cs
- AuthenticationService.cs
- ComponentResourceManager.cs
- FastEncoderWindow.cs
- ObjectNotFoundException.cs
- StronglyTypedResourceBuilder.cs
- Section.cs
- CodeIterationStatement.cs
- GestureRecognitionResult.cs
- InfoCardKeyedHashAlgorithm.cs
- RemotingConfigParser.cs
- EntryPointNotFoundException.cs
- DataFormat.cs
- ExpressionsCollectionConverter.cs
- FontCacheLogic.cs
- Attributes.cs
- CfgSemanticTag.cs
- Filter.cs
- XsdDataContractImporter.cs
- SafeSystemMetrics.cs
- PassportAuthenticationEventArgs.cs
- SoapExtensionImporter.cs
- IUnknownConstantAttribute.cs
- XsltContext.cs
- Tokenizer.cs
- ListControlConvertEventArgs.cs
- DataSourceSelectArguments.cs
- HitTestResult.cs
- AssemblyNameUtility.cs
- RelationshipType.cs
- MembershipValidatePasswordEventArgs.cs
- InputLangChangeEvent.cs
- BaseAddressElement.cs
- PersonalizationState.cs
- ListViewUpdatedEventArgs.cs
- HttpCookie.cs
- DetailsViewUpdatedEventArgs.cs
- ParallelTimeline.cs
- XmlSchemaAttributeGroup.cs
- AdornedElementPlaceholder.cs
- IUnknownConstantAttribute.cs
- StorageEntitySetMapping.cs
- SafeThreadHandle.cs
- XPathNavigatorReader.cs
- DataProviderNameConverter.cs
- X509Certificate.cs
- MobileControlBuilder.cs
- NativeMethods.cs
- AbsoluteQuery.cs
- KeyEvent.cs
- ShaderEffect.cs
- CacheSection.cs
- EdmMember.cs
- ping.cs
- DbConnectionPoolGroup.cs
- XPathBinder.cs
- GC.cs
- CallSiteBinder.cs
- TextServicesManager.cs
- XNodeSchemaApplier.cs
- NullableDoubleSumAggregationOperator.cs
- SettingsSavedEventArgs.cs
- CompilerGeneratedAttribute.cs
- MouseBinding.cs
- CountAggregationOperator.cs
- _Events.cs
- TextFormatterHost.cs
- RawMouseInputReport.cs
- EntityUtil.cs
- MemberInitExpression.cs
- NumericUpDown.cs
- DataGridViewCellMouseEventArgs.cs
- SqlFacetAttribute.cs
- COAUTHINFO.cs
- CustomCredentialPolicy.cs
- AbstractDataSvcMapFileLoader.cs
- CodeDomDecompiler.cs
- Keyboard.cs
- BlurEffect.cs
- CellParagraph.cs
- PaintEvent.cs
- InternalDispatchObject.cs
- ThreadExceptionEvent.cs
- ConstantSlot.cs
- ThreadExceptionDialog.cs
- DataGridDesigner.cs
- UnsafeNativeMethodsPenimc.cs