Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CommonUI / System / Drawing / Advanced / ImageFormat.cs / 1 / 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 class with the specified GUID.
///
public ImageFormat(Guid guid) {
this.guid = 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;}
}
///
///
///
/// Specifies the W3C PNG image format.
///
///
public static ImageFormat Png {
get { return png;}
}
///
///
/// 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;}
}
///
///
///
/// Specifies the Windows icon image format.
///
///
public static ImageFormat Icon {
get { return icon;}
}
///
///
/// Returns a value indicating whether the
/// specified object is an equivalent to this .
///
public override bool Equals(object o) {
ImageFormat format = o as ImageFormat;
if (format == null)
return false;
return this.guid == format.guid;
}
///
///
///
/// Returns a hash code.
///
///
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
///
///
/// Converts this to a human-readable string.
///
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.
//------------------------------------------------------------------------------
//
// 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 class with the specified GUID.
///
public ImageFormat(Guid guid) {
this.guid = 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;}
}
///
///
///
/// Specifies the W3C PNG image format.
///
///
public static ImageFormat Png {
get { return png;}
}
///
///
/// 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;}
}
///
///
///
/// Specifies the Windows icon image format.
///
///
public static ImageFormat Icon {
get { return icon;}
}
///
///
/// Returns a value indicating whether the
/// specified object is an equivalent to this .
///
public override bool Equals(object o) {
ImageFormat format = o as ImageFormat;
if (format == null)
return false;
return this.guid == format.guid;
}
///
///
///
/// Returns a hash code.
///
///
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
///
///
/// Converts this to a human-readable string.
///
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XPathSingletonIterator.cs
- BoundPropertyEntry.cs
- MenuItemBinding.cs
- mediaeventshelper.cs
- SharedUtils.cs
- BridgeDataReader.cs
- CustomAttributeSerializer.cs
- DirectoryInfo.cs
- InvokeHandlers.cs
- CustomAttributeBuilder.cs
- ToolStripDropDownMenu.cs
- ServiceBehaviorElementCollection.cs
- CapacityStreamGeometryContext.cs
- EventProperty.cs
- ListViewItemCollectionEditor.cs
- DeferredSelectedIndexReference.cs
- DatagridviewDisplayedBandsData.cs
- CfgSemanticTag.cs
- HandleCollector.cs
- PageAdapter.cs
- WizardForm.cs
- Wrapper.cs
- DigitalSignatureProvider.cs
- SafeSystemMetrics.cs
- InternalTypeHelper.cs
- WebPartActionVerb.cs
- ScriptControlDescriptor.cs
- ParallelTimeline.cs
- SqlTriggerAttribute.cs
- BamlBinaryWriter.cs
- ObjectHandle.cs
- AspNetHostingPermission.cs
- TreeNodeClickEventArgs.cs
- ProcessModuleCollection.cs
- BaseParser.cs
- GeneralTransform.cs
- SmiMetaDataProperty.cs
- SmtpSection.cs
- UnsafeNativeMethods.cs
- ToolStripPanelRenderEventArgs.cs
- GridViewHeaderRowPresenter.cs
- AssemblyBuilder.cs
- altserialization.cs
- TextSpanModifier.cs
- BitmapEffectCollection.cs
- TextRangeBase.cs
- ExtentJoinTreeNode.cs
- DbSourceCommand.cs
- ReturnType.cs
- ChangePassword.cs
- APCustomTypeDescriptor.cs
- baseaxisquery.cs
- XmlBinaryWriterSession.cs
- ZipPackagePart.cs
- Switch.cs
- PropertyGridEditorPart.cs
- XmlSchemaSimpleTypeRestriction.cs
- ProfileParameter.cs
- DecimalStorage.cs
- OLEDB_Util.cs
- OracleCommand.cs
- DataKeyArray.cs
- BamlRecordWriter.cs
- StyleXamlParser.cs
- Image.cs
- RealizationContext.cs
- ScriptServiceAttribute.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- HealthMonitoringSectionHelper.cs
- HtmlToClrEventProxy.cs
- Base64Stream.cs
- RoutedUICommand.cs
- BamlLocalizationDictionary.cs
- CodeComment.cs
- ContainerSelectorActiveEvent.cs
- NavigateEvent.cs
- Floater.cs
- BaseAddressPrefixFilterElement.cs
- MsmqIntegrationInputChannel.cs
- UnsignedPublishLicense.cs
- DbProviderSpecificTypePropertyAttribute.cs
- XmlSchemaGroupRef.cs
- FacetDescriptionElement.cs
- TryExpression.cs
- XmlMemberMapping.cs
- WebHttpBindingElement.cs
- XmlWriter.cs
- PerformanceCounterPermissionEntry.cs
- SessionConnectionReader.cs
- SoapCommonClasses.cs
- Error.cs
- sitestring.cs
- RenderingBiasValidation.cs
- TrackingStringDictionary.cs
- PrivacyNoticeBindingElementImporter.cs
- BamlRecordWriter.cs
- Zone.cs
- DropDownHolder.cs
- DragAssistanceManager.cs
- DateTimeConstantAttribute.cs