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
- SystemIcons.cs
- SqlFunctions.cs
- DrawingGroup.cs
- ComplexType.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- ResourceManagerWrapper.cs
- XmlnsDictionary.cs
- UIPropertyMetadata.cs
- LinqDataSourceSelectEventArgs.cs
- MimePart.cs
- BasicCommandTreeVisitor.cs
- ParameterBuilder.cs
- DbConnectionPool.cs
- HtmlTableRowCollection.cs
- FrameworkContentElement.cs
- CachedTypeface.cs
- RegisteredArrayDeclaration.cs
- MasterPageParser.cs
- AssertFilter.cs
- TypeContext.cs
- HttpCacheVaryByContentEncodings.cs
- StyleHelper.cs
- BitmapEffectOutputConnector.cs
- LocatorPart.cs
- BlockCollection.cs
- PrefixQName.cs
- SourceSwitch.cs
- GestureRecognizer.cs
- NamespaceMapping.cs
- ComplexObject.cs
- SelectionProviderWrapper.cs
- ContainerActivationHelper.cs
- HebrewNumber.cs
- QueryAccessibilityHelpEvent.cs
- XmlCharCheckingReader.cs
- ImageEditor.cs
- ResourceExpressionBuilder.cs
- DataGridViewCellPaintingEventArgs.cs
- WebServiceMethodData.cs
- SslStream.cs
- StaticExtensionConverter.cs
- TypefaceCollection.cs
- ValueHandle.cs
- EventLogReader.cs
- DbDataReader.cs
- CodeComment.cs
- IsolatedStoragePermission.cs
- ProtocolsConfiguration.cs
- HttpPostServerProtocol.cs
- Variant.cs
- ExitEventArgs.cs
- COM2ColorConverter.cs
- BaseCodePageEncoding.cs
- IOThreadTimer.cs
- ToolStripContentPanelRenderEventArgs.cs
- GcHandle.cs
- DataGridItem.cs
- WmlTextViewAdapter.cs
- ByteAnimation.cs
- TypeValidationEventArgs.cs
- SortDescription.cs
- ImmutableObjectAttribute.cs
- ApplicationSecurityManager.cs
- IISUnsafeMethods.cs
- HWStack.cs
- ContainerSelectorBehavior.cs
- WebBrowsableAttribute.cs
- AttributeQuery.cs
- KeysConverter.cs
- NullableFloatSumAggregationOperator.cs
- ActiveXHelper.cs
- DataFieldCollectionEditor.cs
- XslCompiledTransform.cs
- DocComment.cs
- RefreshPropertiesAttribute.cs
- Dispatcher.cs
- Calendar.cs
- ContextInformation.cs
- SelectionGlyph.cs
- TextEditorTables.cs
- RoutedUICommand.cs
- _NetworkingPerfCounters.cs
- ConnectionManager.cs
- ClrProviderManifest.cs
- SHA256CryptoServiceProvider.cs
- RelationshipType.cs
- DesignerFrame.cs
- DNS.cs
- ButtonAutomationPeer.cs
- DataGridItem.cs
- SmtpLoginAuthenticationModule.cs
- ScriptReference.cs
- DataProtection.cs
- RSAProtectedConfigurationProvider.cs
- DataObjectAttribute.cs
- Line.cs
- MemberDescriptor.cs
- PageThemeBuildProvider.cs
- SqlLiftWhereClauses.cs
- UIElement3D.cs