//=---------------------------------------------------------------------------- // Microsoft Visual Studio // // Microsoft Confidential // Copyright (c) Microsoft Corporation. All Rights Reserved. // // File: ImageParameters140.idl // Contents: Parameters related to the Image Library // // Current Owner: //=---------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// #ifndef INTEROPLIB // Imports - all imports should go here (inside the ifndef) import "oaidl.idl"; import "ocidl.idl"; #endif // INTEROPLIB // Represents an RGBA color with the red channel in the low byte to the alpha channel in the high byte. typedef DWORD RGBA; enum _ImageAttributesFlags { // required flags IAF_Size = 0x00000001, // the LogicalWidth and LogicalHeight fields are valid IAF_Type = 0x00000002, // the ImageType field is valid IAF_Format = 0x00000004, // the Format field is valid IAF_Dpi = 0x00000008, // the Dpi field is valid // optional flags IAF_Background = 0x80000000, // the Background field is valid IAF_Grayscale = 0x40000000, // the returned image should be grayscaled IAF_GrayscaleBiasColor = 0x20000000, // the GrayscaleBiasColor field is valid IAF_HighContrast = 0x10000000, // the HighContrast field is valid // masks IAF_RequiredFlags = IAF_Size | IAF_Type | IAF_Format | IAF_Dpi, IAF_OptionalFlags = IAF_Background | IAF_Grayscale | IAF_GrayscaleBiasColor | IAF_HighContrast, }; typedef DWORD ImageAttributesFlags; enum _UIDataFormat { DF_Win32 = 1, // Matches VSDF_WIN32 for enumeration compatibility DF_WinForms = 2, // Matches VSDF_WINFORMS for enumeration compatibility DF_WPF = 3, // Matches VSDF_WPF for enumeration compatibility }; typedef DWORD UIDataFormat; enum _UIImageType { IT_Bitmap = 1, // the image is a bitmap IT_Icon = 2, // the image is an icon IT_ImageList = 3, // the image is an image list (WinForms, Win32 formats only) }; typedef DWORD UIImageType; enum _ImageMonikerType { IMT_Unknown = 0, // The moniker is invalid or stale IMT_LoadedFromManifest = 1, // The moniker was loaded from a manifest IMT_Custom = 2, // The moniker was created as a result of a custom image being added from outside the image library IMT_System = 3 // The moniker was created within the image library and cannot be deleted }; typedef DWORD ImageMonikerType; enum _UIImageHorizontalAlignment { IHA_Left = 1, // the image is left-aligned within its container IHA_Center = 2, // the image is centered horizontally within its container IHA_Right = 3, // the image is right-aligned within its container }; typedef DWORD UIImageHorizontalAlignment; enum _UIImageVerticalAlignment { IVA_Top = 1, // the image is top-aligned within its container IVA_Center = 2, // the image is centered vertically within its container IVA_Bottom = 3, // the image is bottom-aligned within its container }; typedef DWORD UIImageVerticalAlignment; typedef struct { int StructSize; // the size of the structure ImageAttributesFlags Flags; // flags indicating which fields of the structure are valid int LogicalWidth; // the width of the image, in logical units (e.g. the width at 100% DPI) int LogicalHeight; // the height of the image, in logical units (e.g. the height at 100% DPI) int Dpi; // the DPI setting for the monitor on which the image will be displayed // If this is zero, the number of logical pixels per inch for the // primary screen will be used (e.g. 96 for 100% DPI, 120 for 125% DPI, etc). UIDataFormat Format; // the format of the image (WPF, WinForms, Win32) UIImageType ImageType; // the type of the image (bitmap, icon, or image list) RGBA Background; // [optional] the background color on which the image will be displayed RGBA GrayscaleBiasColor; // [optional] the bias color used to weight a grayscale image // This field is only used if the IAF_Grayscale flag is specified. If this field isn't // supplied when the IAF_Grayscale flag is specified, #40FFFFFF is used as the bias color. // This produces a 75% translucent effect. BOOL HighContrast; // [optional] indicates whether the high-contrast version of the image is requested // If this is TRUE, the high-contrast version of the image will be returned. // If this is FALSE, the normal-contrast version of the image will be returned. // If this isn't supplied, the high-contrast version of the image will be returned // if the system is running in high-contrast mode; otherwise the normal-contrast // version of the image will be returned. } ImageAttributes; //---------------------------------------------------------------------------- // ImageMoniker //---------------------------------------------------------------------------- typedef struct { GUID Guid; int Id; } ImageMoniker; //---------------------------------------------------------------------------- // Represents the definition of a layer used to compose multiple images // into a single merged image. //---------------------------------------------------------------------------- typedef struct { ImageMoniker ImageMoniker; // The ImageMoniker rendered in this layer int VirtualWidth; // The virtual width of this layer. The actual pixel dimensions of the image won't be computed until render time. int VirtualHeight; // The virtual height of this layer. The actual pixel dimensions of the image won't be computed until render time. int VirtualXOffset; // The virtual X offset of the image. This offset is used together with the HorizontalAlignment to place the image within the composite image. int VirtualYOffset; // The virtual Y offset of the image. This offset is used together with the VerticalAlignment to place the image within the composite image. UIImageHorizontalAlignment HorizontalAlignment; // The horizontal alignment of the image within the composite image. UIImageVerticalAlignment VerticalAlignment; // The vertical alignment of the image within the composite image. } ImageCompositionLayer; //---------------------------------------------------------------------------- // Represents a handle which keeps a custom image stored in memory. // Only keeping the IImageHandle strongly referenced in memory will guarantee // that the image associated with the handle's moniker will be kept in memory // in the ImageLibrary. //---------------------------------------------------------------------------- [uuid (B4D44E85-FCF6-481E-BFBF-CDF3A573E298)] interface IImageHandle : IUnknown { [propget] HRESULT Moniker([out, retval] ImageMoniker *moniker); }