Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / Advanced / ImageFormat.cs / 1305376 / ImageFormat.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Drawing.Imaging { using System; using System.Diagnostics; using System.Drawing; using System.ComponentModel; /** * Image format constants */ ////// /// Specifies the format of the image. /// [TypeConverterAttribute(typeof(ImageFormatConverter))] public sealed class ImageFormat { // Format IDs // private static ImageFormat undefined = new ImageFormat(new Guid("{b96b3ca9-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat memoryBMP = new ImageFormat(new Guid("{b96b3caa-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat bmp = new ImageFormat(new Guid("{b96b3cab-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat emf = new ImageFormat(new Guid("{b96b3cac-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat wmf = new ImageFormat(new Guid("{b96b3cad-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat jpeg = new ImageFormat(new Guid("{b96b3cae-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat png = new ImageFormat(new Guid("{b96b3caf-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat gif = new ImageFormat(new Guid("{b96b3cb0-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat tiff = new ImageFormat(new Guid("{b96b3cb1-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat exif = new ImageFormat(new Guid("{b96b3cb2-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat photoCD = new ImageFormat(new Guid("{b96b3cb3-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat flashPIX = new ImageFormat(new Guid("{b96b3cb4-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat icon = new ImageFormat(new Guid("{b96b3cb5-0728-11d3-9d7b-0000f81ef32e}")); private Guid guid; ////// /// Initializes a new instance of the public ImageFormat(Guid guid) { this.guid = guid; } ///class with the specified GUID. /// /// /// Specifies a global unique identifier (GUID) /// that represents this public Guid Guid { get { return guid;} } ///. /// /// /// Specifies a memory bitmap image format. /// public static ImageFormat MemoryBmp { get { return memoryBMP;} } ////// /// Specifies the bitmap image format. /// public static ImageFormat Bmp { get { return bmp;} } ////// /// Specifies the enhanced Windows metafile /// image format. /// public static ImageFormat Emf { get { return emf;} } ////// /// Specifies the Windows metafile image /// format. /// public static ImageFormat Wmf { get { return wmf;} } ////// /// Specifies the GIF image format. /// public static ImageFormat Gif { get { return gif;} } ////// /// Specifies the JPEG image format. /// public static ImageFormat Jpeg { get { return jpeg;} } ////// /// public static ImageFormat Png { get { return png;} } ////// Specifies the W3C PNG image format. /// ////// /// Specifies the Tag Image File /// Format (TIFF) image format. /// public static ImageFormat Tiff { get { return tiff;} } ////// /// Specifies the Exchangable Image Format /// (EXIF). /// public static ImageFormat Exif { get { return exif;} } ////// /// public static ImageFormat Icon { get { return icon;} } ////// Specifies the Windows icon image format. /// ////// /// Returns a value indicating whether the /// specified object is an [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] public override bool Equals(object o) { ImageFormat format = o as ImageFormat; if (format == null) return false; return this.guid == format.guid; } ///equivalent to this . /// /// /// public override int GetHashCode() { return this.guid.GetHashCode(); } #if !FEATURE_PAL // Find any random encoder which supports this format internal ImageCodecInfo FindEncoder() { ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders(); foreach (ImageCodecInfo codec in codecs) { if (codec.FormatID.Equals(this.guid)) return codec; } return null; } #endif ////// Returns a hash code. /// ////// /// Converts this public override string ToString() { if (this == memoryBMP) return "MemoryBMP"; if (this == bmp) return "Bmp"; if (this == emf) return "Emf"; if (this == wmf) return "Wmf"; if (this == gif) return "Gif"; if (this == jpeg) return "Jpeg"; if (this == png) return "Png"; if (this == tiff) return "Tiff"; if (this == exif) return "Exif"; if (this == icon) return "Icon"; return "[ImageFormat: " + guid + "]"; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //to a human-readable string. /// // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Drawing.Imaging { using System; using System.Diagnostics; using System.Drawing; using System.ComponentModel; /** * Image format constants */ ////// /// Specifies the format of the image. /// [TypeConverterAttribute(typeof(ImageFormatConverter))] public sealed class ImageFormat { // Format IDs // private static ImageFormat undefined = new ImageFormat(new Guid("{b96b3ca9-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat memoryBMP = new ImageFormat(new Guid("{b96b3caa-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat bmp = new ImageFormat(new Guid("{b96b3cab-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat emf = new ImageFormat(new Guid("{b96b3cac-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat wmf = new ImageFormat(new Guid("{b96b3cad-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat jpeg = new ImageFormat(new Guid("{b96b3cae-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat png = new ImageFormat(new Guid("{b96b3caf-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat gif = new ImageFormat(new Guid("{b96b3cb0-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat tiff = new ImageFormat(new Guid("{b96b3cb1-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat exif = new ImageFormat(new Guid("{b96b3cb2-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat photoCD = new ImageFormat(new Guid("{b96b3cb3-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat flashPIX = new ImageFormat(new Guid("{b96b3cb4-0728-11d3-9d7b-0000f81ef32e}")); private static ImageFormat icon = new ImageFormat(new Guid("{b96b3cb5-0728-11d3-9d7b-0000f81ef32e}")); private Guid guid; ////// /// Initializes a new instance of the public ImageFormat(Guid guid) { this.guid = guid; } ///class with the specified GUID. /// /// /// Specifies a global unique identifier (GUID) /// that represents this public Guid Guid { get { return guid;} } ///. /// /// /// Specifies a memory bitmap image format. /// public static ImageFormat MemoryBmp { get { return memoryBMP;} } ////// /// Specifies the bitmap image format. /// public static ImageFormat Bmp { get { return bmp;} } ////// /// Specifies the enhanced Windows metafile /// image format. /// public static ImageFormat Emf { get { return emf;} } ////// /// Specifies the Windows metafile image /// format. /// public static ImageFormat Wmf { get { return wmf;} } ////// /// Specifies the GIF image format. /// public static ImageFormat Gif { get { return gif;} } ////// /// Specifies the JPEG image format. /// public static ImageFormat Jpeg { get { return jpeg;} } ////// /// public static ImageFormat Png { get { return png;} } ////// Specifies the W3C PNG image format. /// ////// /// Specifies the Tag Image File /// Format (TIFF) image format. /// public static ImageFormat Tiff { get { return tiff;} } ////// /// Specifies the Exchangable Image Format /// (EXIF). /// public static ImageFormat Exif { get { return exif;} } ////// /// public static ImageFormat Icon { get { return icon;} } ////// Specifies the Windows icon image format. /// ////// /// Returns a value indicating whether the /// specified object is an [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] public override bool Equals(object o) { ImageFormat format = o as ImageFormat; if (format == null) return false; return this.guid == format.guid; } ///equivalent to this . /// /// /// public override int GetHashCode() { return this.guid.GetHashCode(); } #if !FEATURE_PAL // Find any random encoder which supports this format internal ImageCodecInfo FindEncoder() { ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders(); foreach (ImageCodecInfo codec in codecs) { if (codec.FormatID.Equals(this.guid)) return codec; } return null; } #endif ////// Returns a hash code. /// ////// /// Converts this public override string ToString() { if (this == memoryBMP) return "MemoryBMP"; if (this == bmp) return "Bmp"; if (this == emf) return "Emf"; if (this == wmf) return "Wmf"; if (this == gif) return "Gif"; if (this == jpeg) return "Jpeg"; if (this == png) return "Png"; if (this == tiff) return "Tiff"; if (this == exif) return "Exif"; if (this == icon) return "Icon"; return "[ImageFormat: " + guid + "]"; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.to a human-readable string. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EmbossBitmapEffect.cs
- DataAdapter.cs
- RepeaterCommandEventArgs.cs
- ServiceTimeoutsElement.cs
- TdsParserSafeHandles.cs
- DelegateSerializationHolder.cs
- Utilities.cs
- QuaternionKeyFrameCollection.cs
- XmlSortKey.cs
- ObjectHelper.cs
- BamlRecords.cs
- AssociationSetMetadata.cs
- AccessDataSourceView.cs
- XmlWriterSettings.cs
- HwndProxyElementProvider.cs
- CapacityStreamGeometryContext.cs
- ToolConsole.cs
- ToolStripPanelRow.cs
- WebRequestModuleElementCollection.cs
- SHA384Managed.cs
- Enum.cs
- HttpModuleCollection.cs
- StylusDownEventArgs.cs
- PathFigure.cs
- ParagraphResult.cs
- PersonalizationStateInfo.cs
- MiniLockedBorderGlyph.cs
- counter.cs
- SplineKeyFrames.cs
- IdentityValidationException.cs
- odbcmetadatafactory.cs
- ElementHostAutomationPeer.cs
- AsymmetricSignatureFormatter.cs
- mda.cs
- Exceptions.cs
- FullTextLine.cs
- MsmqIntegrationElement.cs
- MetaForeignKeyColumn.cs
- QilReference.cs
- FactoryId.cs
- XmlParser.cs
- UDPClient.cs
- CngKey.cs
- ReadOnlyNameValueCollection.cs
- MessageParameterAttribute.cs
- MemoryMappedFileSecurity.cs
- FlowchartStart.xaml.cs
- UserControlDocumentDesigner.cs
- ConnectivityStatus.cs
- RepeaterCommandEventArgs.cs
- PropertyItemInternal.cs
- Point3DCollection.cs
- EventManager.cs
- IconConverter.cs
- ComboBoxDesigner.cs
- NavigationHelper.cs
- HotSpotCollectionEditor.cs
- PrintingPermissionAttribute.cs
- RenderData.cs
- ConfigXmlCDataSection.cs
- HtmlContainerControl.cs
- LinqDataSourceView.cs
- FrameworkElement.cs
- DocumentSchemaValidator.cs
- NavigationPropertyEmitter.cs
- IdentitySection.cs
- ErrorEventArgs.cs
- XmlSerializerAssemblyAttribute.cs
- _CookieModule.cs
- _SingleItemRequestCache.cs
- SyndicationDeserializer.cs
- ShaderEffect.cs
- AdRotator.cs
- NamedPipeAppDomainProtocolHandler.cs
- ScrollBarRenderer.cs
- SslStream.cs
- TextStore.cs
- InlineUIContainer.cs
- InProcStateClientManager.cs
- SamlAuthenticationStatement.cs
- ThreadAttributes.cs
- WebColorConverter.cs
- ColorInterpolationModeValidation.cs
- SqlDataSource.cs
- DockAndAnchorLayout.cs
- ConditionalBranch.cs
- ITreeGenerator.cs
- GridViewUpdateEventArgs.cs
- RegexWriter.cs
- BufferCache.cs
- ProxySimple.cs
- TrustLevel.cs
- CreateDataSourceDialog.cs
- HtmlWindow.cs
- SoapElementAttribute.cs
- DataGridRowAutomationPeer.cs
- SqlMethodCallConverter.cs
- XmlSchemaAll.cs
- WindowsPrincipal.cs
- TimeSpanMinutesConverter.cs