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
- BuildProviderCollection.cs
- TreeViewItem.cs
- counter.cs
- BrowserInteropHelper.cs
- DataKey.cs
- QueryResponse.cs
- QuaternionValueSerializer.cs
- StringConcat.cs
- CaseInsensitiveHashCodeProvider.cs
- UnmanagedBitmapWrapper.cs
- EmptyQuery.cs
- XmlC14NWriter.cs
- WebServiceResponse.cs
- InstanceLockQueryResult.cs
- Event.cs
- QueryContinueDragEvent.cs
- AdRotator.cs
- InvokeProviderWrapper.cs
- RoleService.cs
- EventSourceCreationData.cs
- ActiveDocumentEvent.cs
- AssemblyBuilder.cs
- SafeCryptoHandles.cs
- Property.cs
- Win32Native.cs
- ToolStripControlHost.cs
- DESCryptoServiceProvider.cs
- TCPListener.cs
- KeyInfo.cs
- CustomLineCap.cs
- ReflectionUtil.cs
- TripleDES.cs
- MetadataSerializer.cs
- MailBnfHelper.cs
- Delay.cs
- ObjectStateFormatter.cs
- CookielessHelper.cs
- DataSpaceManager.cs
- DbSetClause.cs
- HierarchicalDataBoundControlAdapter.cs
- Baml2006SchemaContext.cs
- InputMethodStateTypeInfo.cs
- EventsTab.cs
- HttpMethodConstraint.cs
- PrincipalPermission.cs
- SourceChangedEventArgs.cs
- GeometryGroup.cs
- FileLogRecordStream.cs
- PresentationAppDomainManager.cs
- ParseElement.cs
- ExtractorMetadata.cs
- ListViewAutomationPeer.cs
- SHA384.cs
- __Error.cs
- XmlSignificantWhitespace.cs
- FixedSOMContainer.cs
- DataGridViewTextBoxColumn.cs
- FontUnitConverter.cs
- SchemaImporter.cs
- RoleGroup.cs
- ExpandCollapseIsCheckedConverter.cs
- webclient.cs
- DispatchChannelSink.cs
- HitTestParameters.cs
- XmlSerializerAssemblyAttribute.cs
- WebConfigManager.cs
- TriggerActionCollection.cs
- XmlNode.cs
- PageAsyncTask.cs
- TrustManagerPromptUI.cs
- RootProfilePropertySettingsCollection.cs
- metadatamappinghashervisitor.cs
- HierarchicalDataTemplate.cs
- DynamicPropertyHolder.cs
- IgnoreFlushAndCloseStream.cs
- PointAnimationClockResource.cs
- EntityCommandExecutionException.cs
- MessageAction.cs
- Int64.cs
- MetadataCache.cs
- PackWebRequest.cs
- SapiGrammar.cs
- LockCookie.cs
- CodePrimitiveExpression.cs
- FreezableDefaultValueFactory.cs
- TrustLevelCollection.cs
- RepeatBehavior.cs
- ComponentEditorPage.cs
- ContextBase.cs
- WindowInteropHelper.cs
- Win32MouseDevice.cs
- HyperLinkStyle.cs
- SizeAnimation.cs
- EntityReference.cs
- DataControlFieldTypeEditor.cs
- Shared.cs
- ObjectDesignerDataSourceView.cs
- NestedContainer.cs
- ZipPackagePart.cs
- ObjectQuery.cs