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
- Underline.cs
- PerformanceCountersElement.cs
- FormsAuthenticationUserCollection.cs
- DataSet.cs
- UInt32Storage.cs
- CodeConditionStatement.cs
- CorruptingExceptionCommon.cs
- FontFamilyIdentifier.cs
- EntityDataSourceDataSelectionPanel.cs
- Mutex.cs
- BoundConstants.cs
- NameGenerator.cs
- OwnerDrawPropertyBag.cs
- StructuredTypeInfo.cs
- DefaultAssemblyResolver.cs
- NativeMethods.cs
- ScriptDescriptor.cs
- InvalidProgramException.cs
- ObjectContextServiceProvider.cs
- RegularExpressionValidator.cs
- BooleanAnimationUsingKeyFrames.cs
- RemoteWebConfigurationHostStream.cs
- FontStretches.cs
- BrushValueSerializer.cs
- ConditionalWeakTable.cs
- ProvidePropertyAttribute.cs
- ExtenderProvidedPropertyAttribute.cs
- ProfilePropertySettingsCollection.cs
- RequiredAttributeAttribute.cs
- AttributedMetaModel.cs
- GiveFeedbackEvent.cs
- ProcessHostConfigUtils.cs
- GregorianCalendar.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- BeginStoryboard.cs
- GridViewRowCollection.cs
- HttpListenerPrefixCollection.cs
- IdentityValidationException.cs
- EnumValidator.cs
- ObjectAnimationBase.cs
- WebPartZoneBaseDesigner.cs
- Perspective.cs
- XmlSerializableWriter.cs
- XmlEncodedRawTextWriter.cs
- Triangle.cs
- DataServiceHost.cs
- smtpconnection.cs
- IssuedTokenServiceElement.cs
- ILGenerator.cs
- ButtonColumn.cs
- MemoryPressure.cs
- ColorConvertedBitmapExtension.cs
- QilValidationVisitor.cs
- Logging.cs
- StorageComplexTypeMapping.cs
- EventEntry.cs
- DependencyPropertyValueSerializer.cs
- ConfigurationStrings.cs
- GenericTextProperties.cs
- ProvidersHelper.cs
- WebDisplayNameAttribute.cs
- ISO2022Encoding.cs
- Int32CollectionConverter.cs
- Msec.cs
- FileRecordSequenceHelper.cs
- HttpException.cs
- mediaeventargs.cs
- EntityDataSourceUtil.cs
- DictionaryEntry.cs
- AssemblyAttributesGoHere.cs
- formatstringdialog.cs
- QilBinary.cs
- SpeechSynthesizer.cs
- LogPolicy.cs
- UndoUnit.cs
- PixelFormats.cs
- Sql8ConformanceChecker.cs
- EdmMember.cs
- Button.cs
- oledbmetadatacolumnnames.cs
- FixedPageProcessor.cs
- WindowsListViewScroll.cs
- KeyNotFoundException.cs
- TableCell.cs
- XXXInfos.cs
- PointCollectionValueSerializer.cs
- TextEditorCopyPaste.cs
- TemplateControlParser.cs
- InputMethod.cs
- PipelineModuleStepContainer.cs
- SoapFormatExtensions.cs
- SizeChangedInfo.cs
- WebColorConverter.cs
- EmptyReadOnlyDictionaryInternal.cs
- AsyncResult.cs
- Point3DAnimation.cs
- LogEntryHeaderSerializer.cs
- Activity.cs
- ApplicationSecurityManager.cs
- Attributes.cs