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
- Ops.cs
- TypeElement.cs
- MouseBinding.cs
- TypeTypeConverter.cs
- CodeTypeConstructor.cs
- Debugger.cs
- TreeNodeEventArgs.cs
- UnsafeNativeMethodsPenimc.cs
- BypassElementCollection.cs
- BaseAppDomainProtocolHandler.cs
- CssClassPropertyAttribute.cs
- ActivityDesigner.cs
- XmlSchemaObjectCollection.cs
- SmtpLoginAuthenticationModule.cs
- arabicshape.cs
- XmlSchemaAnyAttribute.cs
- basevalidator.cs
- CombinedGeometry.cs
- CommandEventArgs.cs
- XmlAttributeOverrides.cs
- IPipelineRuntime.cs
- SqlDataSourceSelectingEventArgs.cs
- HashCodeCombiner.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- ClientRuntimeConfig.cs
- AttributeEmitter.cs
- SqlResolver.cs
- SqlDataSourceEnumerator.cs
- SQlBooleanStorage.cs
- ExpressionLexer.cs
- SpotLight.cs
- CompleteWizardStep.cs
- AuthorizationRule.cs
- WebUtil.cs
- DirtyTextRange.cs
- SnapshotChangeTrackingStrategy.cs
- MethodExpr.cs
- ObjectItemNoOpAssemblyLoader.cs
- RepeatBehavior.cs
- Model3DGroup.cs
- XmlMemberMapping.cs
- XslUrlEditor.cs
- SizeConverter.cs
- MimeImporter.cs
- WebPartVerb.cs
- HttpCacheVaryByContentEncodings.cs
- DataGridTablesFactory.cs
- Hash.cs
- ListManagerBindingsCollection.cs
- SchemaImporter.cs
- SinglePageViewer.cs
- ResourceExpression.cs
- TextFindEngine.cs
- BitmapEffect.cs
- ProxyWebPart.cs
- SerTrace.cs
- SqlConnectionPoolGroupProviderInfo.cs
- __FastResourceComparer.cs
- DataGridLinkButton.cs
- AlternateViewCollection.cs
- ButtonFlatAdapter.cs
- HttpWebResponse.cs
- EnlistmentTraceIdentifier.cs
- ConfigurationValidatorAttribute.cs
- RegionInfo.cs
- CodeStatement.cs
- FormattedText.cs
- ViewService.cs
- ExtensionSimplifierMarkupObject.cs
- FixedSOMGroup.cs
- DataServiceRequestOfT.cs
- AssemblyInfo.cs
- DataGridViewLinkCell.cs
- ObjectCloneHelper.cs
- ErrorProvider.cs
- XdrBuilder.cs
- TextDecoration.cs
- WebPartEditorApplyVerb.cs
- DelegateHelpers.Generated.cs
- _NTAuthentication.cs
- Hashtable.cs
- MailSettingsSection.cs
- TextEndOfParagraph.cs
- LayoutUtils.cs
- SerializableAttribute.cs
- Converter.cs
- Graphics.cs
- ListViewInsertEventArgs.cs
- DataTemplate.cs
- DayRenderEvent.cs
- base64Transforms.cs
- SoapMessage.cs
- WebPartZoneCollection.cs
- RIPEMD160.cs
- XmlILConstructAnalyzer.cs
- SHA256.cs
- DiagnosticsConfigurationHandler.cs
- RangeExpression.cs
- FreezableOperations.cs
- DataPagerFieldItem.cs