Code:
/ DotNET / DotNET / 8.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
- WebServiceParameterData.cs
- IndexerNameAttribute.cs
- ControlEvent.cs
- WCFServiceClientProxyGenerator.cs
- TraceSource.cs
- LoadMessageLogger.cs
- GroupAggregateExpr.cs
- SecurityKeyType.cs
- CodeAttachEventStatement.cs
- DbConnectionPoolOptions.cs
- Documentation.cs
- ArglessEventHandlerProxy.cs
- SqlUserDefinedAggregateAttribute.cs
- DependencySource.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- Page.cs
- GeneralTransform3DTo2D.cs
- Bold.cs
- AddingNewEventArgs.cs
- CachedRequestParams.cs
- Decoder.cs
- XmlNamespaceDeclarationsAttribute.cs
- XmlSchemaSimpleTypeList.cs
- AssociationTypeEmitter.cs
- ToolboxItemLoader.cs
- QuaternionKeyFrameCollection.cs
- BaseDataBoundControl.cs
- ConfigPathUtility.cs
- Padding.cs
- MarkupProperty.cs
- WmlLiteralTextAdapter.cs
- ContentElement.cs
- BamlWriter.cs
- SystemColors.cs
- CompilerCollection.cs
- TypeDescriptionProviderAttribute.cs
- DefaultWorkflowTransactionService.cs
- SchemaDeclBase.cs
- RegistrationServices.cs
- ListBoxChrome.cs
- LinearGradientBrush.cs
- ConfigurationElementCollection.cs
- CodeActivityMetadata.cs
- IdentitySection.cs
- WebPartTransformerAttribute.cs
- DataGridViewTextBoxColumn.cs
- OrderingQueryOperator.cs
- Point3DCollection.cs
- ContentElement.cs
- XmlBinaryWriterSession.cs
- HwndTarget.cs
- SyndicationSerializer.cs
- ExpressionList.cs
- InvalidPropValue.cs
- CacheMemory.cs
- CroppedBitmap.cs
- HtmlTextArea.cs
- ConsoleKeyInfo.cs
- panel.cs
- StringCollectionMarkupSerializer.cs
- CroppedBitmap.cs
- SoapHeaderAttribute.cs
- ObjectViewEntityCollectionData.cs
- BitmapCache.cs
- DiagnosticTrace.cs
- PanelStyle.cs
- RSAProtectedConfigurationProvider.cs
- EmptyReadOnlyDictionaryInternal.cs
- TextBounds.cs
- PropertyDescriptorGridEntry.cs
- FontFamily.cs
- PropertyGridEditorPart.cs
- IfAction.cs
- ConfigurationSettings.cs
- SoapServerMethod.cs
- Control.cs
- SafeEventLogReadHandle.cs
- LOSFormatter.cs
- Operator.cs
- PointLight.cs
- EntityTransaction.cs
- RuntimeConfigurationRecord.cs
- SqlDataSource.cs
- MailMessage.cs
- HttpPostedFile.cs
- UseLicense.cs
- QuaternionRotation3D.cs
- ConnectionPointCookie.cs
- DynamicEndpoint.cs
- WebMessageEncodingElement.cs
- HtmlForm.cs
- XamlFilter.cs
- ValidationErrorCollection.cs
- EntityDataSourceWizardForm.cs
- BookmarkScopeHandle.cs
- Context.cs
- XmlSchemaException.cs
- ZoneMembershipCondition.cs
- Html32TextWriter.cs
- DbProviderServices.cs