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
- BindingRestrictions.cs
- DataTrigger.cs
- CheckableControlBaseAdapter.cs
- TableStyle.cs
- EnvelopedPkcs7.cs
- invalidudtexception.cs
- BasicBrowserDialog.designer.cs
- DBCommandBuilder.cs
- TriggerBase.cs
- GC.cs
- ImageClickEventArgs.cs
- ToolStripLabel.cs
- PropertyChangingEventArgs.cs
- ProfileGroupSettingsCollection.cs
- WindowsIdentity.cs
- MemoryRecordBuffer.cs
- SqlDependencyListener.cs
- XmlRawWriter.cs
- AlternateView.cs
- RowToParametersTransformer.cs
- UnconditionalPolicy.cs
- FilteredDataSetHelper.cs
- ThrowHelper.cs
- FieldNameLookup.cs
- WebPageTraceListener.cs
- ServiceRouteHandler.cs
- odbcmetadatacollectionnames.cs
- ExpressionVisitorHelpers.cs
- PersonalizationStateQuery.cs
- ElementAction.cs
- SQLMembershipProvider.cs
- FormClosingEvent.cs
- NativeMethods.cs
- EllipseGeometry.cs
- SchemaConstraints.cs
- RequestResizeEvent.cs
- _SSPIWrapper.cs
- StrongNameKeyPair.cs
- ColorDialog.cs
- FilterQuery.cs
- NetworkStream.cs
- DefaultValueConverter.cs
- Currency.cs
- TableLayoutCellPaintEventArgs.cs
- SubMenuStyleCollection.cs
- FileAuthorizationModule.cs
- EncoderFallback.cs
- DispatcherExceptionEventArgs.cs
- DataGridCell.cs
- EdmItemCollection.cs
- Substitution.cs
- TrustManagerMoreInformation.cs
- SafeFindHandle.cs
- DoubleCollectionConverter.cs
- Message.cs
- WebEvents.cs
- X509CertificateCollection.cs
- UnhandledExceptionEventArgs.cs
- PermissionRequestEvidence.cs
- StylusPointPropertyInfoDefaults.cs
- WindowsSlider.cs
- SettingsPropertyValue.cs
- TemplatedMailWebEventProvider.cs
- QualifiedCellIdBoolean.cs
- BlurEffect.cs
- StreamInfo.cs
- DataGridViewCellStyleConverter.cs
- RawStylusActions.cs
- RotateTransform3D.cs
- UriSection.cs
- HttpWriter.cs
- ConfigurationPropertyCollection.cs
- Soap11ServerProtocol.cs
- DoubleAnimationUsingKeyFrames.cs
- TemplateField.cs
- InstanceKeyCompleteException.cs
- DataGridRowHeaderAutomationPeer.cs
- DataGridViewComboBoxCell.cs
- LinkLabel.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- ResourceAssociationType.cs
- HandlerBase.cs
- SecurityUniqueId.cs
- ActivityAction.cs
- ApplicationFileParser.cs
- JsonMessageEncoderFactory.cs
- InstanceKey.cs
- CheckBoxStandardAdapter.cs
- XmlFileEditor.cs
- SafeIUnknown.cs
- SimpleExpression.cs
- RelationshipConverter.cs
- NavigatorOutput.cs
- sqlmetadatafactory.cs
- PartialCachingAttribute.cs
- TreeNode.cs
- BooleanFunctions.cs
- ItemMap.cs
- DragStartedEventArgs.cs
- Transform.cs