【控件功能】我来做练习- DELHI桌面歌词技术GDI-API

这篇博客详细介绍了如何使用GDI-API来实现DELHI桌面歌词技术,包括核心源码的解析,如ValueTypeFromULONG和GetMetaDataIDString等函数的实现,以及与图像处理相关的函数,如DrawImage和EnumerateMetafile等。
摘要由CSDN通过智能技术生成

DELHI桌面歌词技术GDI-API

提示:这里可以添加技术概要

核心源码

提示:GDIPUTIL.pas
interface
uses
Windows,
GDIPAPI,
GDIPOBJ;

function ValueTypeFromULONG(Type_: ULONG): String;
function GetMetaDataIDString(id: ULONG): string;
function GetEncoderClsid(format: String; out pClsid: TGUID): integer;
function GetStatus(Stat: TStatus): string;
function PixelFormatString(PixelFormat: TPixelFormat): string;

{from WinNT.h}
// creates a language identifier from a primary language identifier and a
// sublanguage identifier for the TStringFormat & TFontFamily class.
function MakeLangID(PrimaryLanguage, SubLanguage: LANGID): WORD;

implementation

function ValueTypeFromULONG(Type_: ULONG): String;
begin
case Type_ of
0 : result := ‘Nothing’;
1 : result := ‘PropertyTagTypeByte’;
2 : result := ‘PropertyTagTypeASCII’;
3 : result := ‘PropertyTagTypeShort’;
4 : result := ‘PropertyTagTypeLong’;
5 : result := ‘PropertyTagTypeRational’;
6 : result := ‘Nothing’;
7 : result := ‘PropertyTagTypeUndefined’;
8 : result := ‘Nothing’;
9 : result := ‘PropertyTagTypeSLONG’;
10: result := ‘PropertyTagTypeSRational’;
else
result := ‘’;
end;
end;

function GetMetaDataIDString(id: ULONG): string;
begin
case id of
PropertyTagExifIFD : result := ‘PropertyTagExifIFD’;
PropertyTagGpsIFD : result := ‘PropertyTagGpsIFD’;
PropertyTagNewSubfileType : result := ‘PropertyTagNewSubfileType’;
PropertyTagSubfileType : result := ‘PropertyTagSubfileType’;
PropertyTagImageWidth : result := ‘PropertyTagImageWidth’;
PropertyTagImageHeight : result := ‘PropertyTagImageHeight’;
PropertyTagBitsPerSample : result := ‘PropertyTagBitsPerSample’;
PropertyTagCompression : result := ‘PropertyTagCompression’;
PropertyTagPhotometricInterp : result := ‘PropertyTagPhotometricInterp’;
PropertyTagThreshHolding : result := ‘PropertyTagThreshHolding’;
PropertyTagCellWidth : result := ‘PropertyTagCellWidth’;
PropertyTagCellHeight : result := ‘PropertyTagCellHeight’;
PropertyTagFillOrder : result := ‘PropertyTagFillOrder’;
PropertyTagDocumentName : result := ‘PropertyTagDocumentName’;
PropertyTagImageDescription : result := ‘PropertyTagImageDescription’;
PropertyTagEquipMake : result := ‘PropertyTagEquipMake’;
PropertyTagEquipModel : result := ‘PropertyTagEquipModel’;
PropertyTagStripOffsets : result := ‘PropertyTagStripOffsets’;
PropertyTagOrientation : result := ‘PropertyTagOrientation’;
PropertyTagSamplesPerPixel : result := ‘PropertyTagSamplesPerPixel’;
PropertyTagRowsPerStrip : result := ‘PropertyTagRowsPerStrip’;
PropertyTagStripBytesCount : result := ‘PropertyTagStripBytesCount’;
PropertyTagMinSampleValue : result := ‘PropertyTagMinSampleValue’;
PropertyTagMaxSampleValue : result := ‘PropertyTagMaxSampleValue’;
PropertyTagXResolution : result := ‘PropertyTagXResolution’;
PropertyTagYResolution : result := ‘PropertyTagYResolution’;
PropertyTagPlanarConfig : result := ‘PropertyTagPlanarConfig’;
PropertyTagPageName : result := ‘PropertyTagPageName’;
PropertyTagXPosition : result := ‘PropertyTagXPosition’;
PropertyTagYPosition : result := ‘PropertyTagYPosition’;
PropertyTagFreeOffset : result := ‘PropertyTagFreeOffset’;
PropertyTagFreeByteCounts : result := ‘PropertyTagFreeByteCounts’;
PropertyTagGrayResponseUnit : result := ‘PropertyTagGrayResponseUnit’;
PropertyTagGrayResponseCurve : result := ‘PropertyTagGrayResponseCurve’;
PropertyTagT4Option : result := ‘PropertyTagT4Option’;
PropertyTagT6Option : result := ‘PropertyTagT6Option’;
PropertyTagResolutionUnit : result := ‘PropertyTagResolutionUnit’;
PropertyTagPageNumber : result := ‘PropertyTagPageNumber’;
PropertyTagTransferFuncition : result := ‘PropertyTagTransferFuncition’;
PropertyTagSoftwareUsed : result := ‘PropertyTagSoftwareUsed’;
PropertyTagDateTime : result := ‘PropertyTagDateTime’;
PropertyTagArtist : result := ‘PropertyTagArtist’;
PropertyTagHostComputer : result := ‘PropertyTagHostComputer’;
PropertyTagPredictor : result := ‘PropertyTagPredictor’;
PropertyTagWhitePoint : result := ‘PropertyTagWhitePoint’;
PropertyTagPrimaryChromaticities : result := ‘PropertyTagPrimaryChromaticities’;
PropertyTagColorMap : result := ‘PropertyTagColorMap’;
PropertyTagHalftoneHints : result := ‘PropertyTagHalftoneHints’;
PropertyTagTileWidth : result := ‘PropertyTagTileWidth’;
PropertyTagTileLength : result := ‘PropertyTagTileLength’;
PropertyTagTileOffset : result := ‘PropertyTagTileOffset’;
PropertyTagTileByteCounts : result := ‘PropertyTagTileByteCounts’;
PropertyTagInkSet : result := ‘PropertyTagInkSet’;
PropertyTagInkNames : result := ‘PropertyTagInkNames’;
PropertyTagNumberOfInks : result := ‘PropertyTagNumberOfInks’;
PropertyTagDotRange : result := ‘PropertyTagDotRange’;
PropertyTagTargetPrinter : result := ‘PropertyTagTargetPrinter’;
PropertyTagExtraSamples : result := ‘PropertyTagExtraSamples’;
PropertyTagSampleFormat : result := ‘PropertyTagSampleFormat’;
PropertyTagSMinSampleValue : result := ‘PropertyTagSMinSampleValue’;
PropertyTagSMaxSampleValue : result := ‘PropertyTagSMaxSampleValue’;
PropertyTagTransferRange : result := ‘PropertyTagTransferRange’;
PropertyTagJPEGProc : result := ‘PropertyTagJPEGProc’;
PropertyTagJPEGInterFormat : result := ‘PropertyTagJPEGInterFormat’;
PropertyTagJPEGInterLength : result := ‘PropertyTagJPEGInterLength’;
PropertyTagJPEGRestartInterval : result := ‘PropertyTagJPEGRestartInterval’;
PropertyTagJPEGLosslessPredictors : result := ‘PropertyTagJPEGLosslessPredictors’;
PropertyTagJPEGPointTransforms : result := ‘PropertyTagJPEGPointTransforms’;
PropertyTagJPEGQTables : result := ‘PropertyTagJPEGQTables’;
PropertyTagJPEGDCTables : result := ‘PropertyTagJPEGDCTables’;
PropertyTagJPEGACTables : result := ‘PropertyTagJPEGACTables’;
PropertyTagYCbCrCoefficients : result := ‘PropertyTagYCbCrCoefficients’;
PropertyTagYCbCrSubsampling : result := ‘PropertyTagYCbCrSubsampling’;
PropertyTagYCbCrPositioning : result := ‘PropertyTagYCbCrPositioning’;
PropertyTagREFBlackWhite : result := ‘PropertyTagREFBlackWhite’;
PropertyTagICCProfile : result := ‘PropertyTagICCProfile’;
PropertyTagGamma : result := ‘PropertyTagGamma’;
PropertyTagICCProfileDescriptor : result := ‘PropertyTagICCProfileDescriptor’;
PropertyTagSRGBRenderingIntent : result := ‘PropertyTagSRGBRenderingIntent’;
PropertyTagImageTitle : result := ‘PropertyTagImageTitle’;
PropertyTagCopyright : result := ‘PropertyTagCopyright’;
PropertyTagResolutionXUnit : result := ‘PropertyTagResolutionXUnit’;
PropertyTagResolutionYUnit : result := ‘PropertyTagResolutionYUnit’;
PropertyTagResolutionXLengthUnit : result := ‘PropertyTagResolutionXLengthUnit’;
PropertyTagResolutionYLengthUnit : result := ‘PropertyTagResolutionYLengthUnit’;
PropertyTagPrintFlags : result := ‘PropertyTagPrintFlags’;
PropertyTagPrintFlagsVersion : result := ‘PropertyTagPrintFlagsVersion’;
PropertyTagPrintFlagsCrop : result := ‘PropertyTagPrintFlagsCrop’;
PropertyTagPrintFlagsBleedWidth : result := ‘PropertyTagPrintFlagsBleedWidth’;
PropertyTagPrintFlagsBleedWidthScale : result := ‘PropertyTagPrintFlagsBleedWidthScale’;
PropertyTagHalftoneLPI : result := ‘PropertyTagHalftoneLPI’;
PropertyTagHalftoneLPIUnit : result := ‘PropertyTagHalftoneLPIUnit’;
PropertyTagHalftoneDegree : result := ‘PropertyTagHalftoneDegree’;
PropertyTagHalftoneShape : result := ‘PropertyTagHalftoneShape’;
PropertyTagHalftoneMisc : result := ‘PropertyTagHalftoneMisc’;
PropertyTagHalftoneScreen : result := ‘PropertyTagHalftoneScreen’;
PropertyTagJPEGQuality : result := ‘PropertyTagJPEGQuality’;
PropertyTagGridSize : result := ‘PropertyTagGridSize’;
PropertyTagThumbnailFormat : result := ‘PropertyTagThumbnailFormat’;
PropertyTagThumbnailWidth : result := ‘PropertyTagThumbnailWidth’;
PropertyTagThumbnailHeight : result := ‘PropertyTagThumbnailHeight’;
PropertyTagThumbnailColorDepth : result := ‘PropertyTagThumbnailColorDepth’;
PropertyTagThumbnailPlanes : result := ‘PropertyTagThumbnailPlanes’;
PropertyTagThumbnailRawBytes : result := ‘PropertyTagThumbnailRawBytes’;
PropertyTagThumbnailSize : result := ‘PropertyTagThumbnailSize’;
PropertyTagThumbnailCompressedSize : result := ‘PropertyTagThumbnailCompressedSize’;
PropertyTagColorTransferFunction : result := ‘PropertyTagColorTransferFunction’;
PropertyTagThumbnailData : result := ‘PropertyTagThumbnailData’;
PropertyTagThumbnailImageWidth : result := ‘PropertyTagThumbnailImageWidth’;
PropertyTagThumbnailImageHeight : result := ‘PropertyTagThumbnailImageHeight’;
PropertyTagThumbnailBitsPerSample : result := ‘PropertyTagThumbnailBitsPerSample’;
PropertyTagThumbnailCompression : result := ‘PropertyTagThumbnailCompression’;
PropertyTagThumbnailPhotometricInterp : result := ‘PropertyTagThumbnailPhotometricInterp’;
PropertyTagThumbnailImageDescription : result := ‘PropertyTagThumbnailImageDescription’;
PropertyTagThumbnailEquipMake : result := ‘PropertyTagThumbnailEquipMake’;
PropertyTagThumbnailEquipModel : result := ‘PropertyTagThumbnailEquipModel’;
PropertyTagThumbnailStripOffsets : result := ‘PropertyTagThumbnailStripOffsets’;
PropertyTagThumbnailOrientation : result := ‘PropertyTagThumbnailOrientation’;
PropertyTagThumbnailSamplesPerPixel : result := ‘PropertyTagThumbnailSamplesPerPixel’;
PropertyTagThumbnailRowsPerStrip : result := ‘PropertyTagThumbnailRowsPerStrip’;
PropertyTagThumbnailStripBytesCount : result := ‘PropertyTagThumbnailStripBytesCount’;
PropertyTagThumbnailResolutionX : result := ‘PropertyTagThumbnailResolutionX’;
PropertyTagThumbnailResolutionY : result := ‘PropertyTagThumbnailResolutionY’;
PropertyTagThumbnailPlanarConfig : result := ‘PropertyTagThumbnailPlanarConfig’;
PropertyTagThumbnailResolutionUnit : result := ‘PropertyTagThumbnailResolutionUnit’;
PropertyTagThumbnailTransferFunction : result := ‘PropertyTagThumbnailTransferFunction’;
PropertyTagThumbnailSoftwareUsed : result := ‘PropertyTagThumbnailSoftwareUsed’;
PropertyTagThumbnailDateTime : result := ‘PropertyTagThumbnailDateTime’;
PropertyTagThumbnailArtist : result := ‘PropertyTagThumbnailArtist’;
PropertyTagThumbnailWhitePoint : result := ‘PropertyTagThumbnailWhitePoint’;
PropertyTagThumbnailPrimaryChromaticities : result := ‘PropertyTagThumbnailPrimaryChromaticities’;
PropertyTagThumbnailYCbCrCoefficients : result := ‘PropertyTagThumbnailYCbCrCoefficients’;
PropertyTagThumbnailYCbCrSubsampling : result := ‘PropertyTagThumbnailYCbCrSubsampling’;
PropertyTagThumbnailYCbCrPositioning : result := ‘PropertyTagThumbnailYCbCrPositioning’;
PropertyTagThumbnailRefBlackWhite : result := ‘PropertyTagThumbnailRefBlackWhite’;
PropertyTagThumbnailCopyRight : result := ‘PropertyTagThumbnailCopyRight’;
PropertyTagLuminanceTable : result := ‘PropertyTagLuminanceTable’;
PropertyTagChrominanceTable : result := ‘PropertyTagChrominanceTable’;
PropertyTagFrameDelay : result := ‘PropertyTagFrameDelay’;
PropertyTagLoopCount : result := ‘PropertyTagLoopCount’;
PropertyTagPixelUnit : result := ‘PropertyTagPixelUnit’;
PropertyTagPixelPerUnitX : result := ‘PropertyTagPixelPerUnitX’;
PropertyTagPixelPerUnitY : result := ‘PropertyTagPixelPerUnitY’;
PropertyTagPaletteHistogram : result := ‘PropertyTagPaletteHistogram’;
PropertyTagExifExposureTime : result := ‘PropertyTagExifExposureTime’;
PropertyTagExifFNumber : result := ‘PropertyTagExifFNumber’;
PropertyTagExifExposureProg : result := ‘PropertyTagExifExposureProg’;
PropertyTagExifSpectralSense : result := ‘PropertyTagExifSpectralSense’;
PropertyTagExifISOSpeed : result := ‘PropertyTagExifISOSpeed’;
PropertyTagExifOECF : result := ‘PropertyTagExifOECF’;
PropertyTagExifVer : result := ‘PropertyTagExifVer’;
PropertyTagExifDTOrig : result := ‘PropertyTagExifDTOrig’;
PropertyTagExifDTDigitized : result := ‘PropertyTagExifDTDigitized’;
PropertyTagExifCompConfig : result := ‘PropertyTagExifCompConfig’;
PropertyTagExifCompBPP : result := ‘PropertyTagExifCompBPP’;
PropertyTagExifShutterSpeed : result := ‘PropertyTagExifShutterSpeed’;
PropertyTagExifAperture : result := ‘PropertyTagExifAperture’;
PropertyTagExifBrightness : result := ‘PropertyTagExifBrightness’;
PropertyTagExifExposureBias : result := ‘PropertyTagExifExposureBias’;
PropertyTagExifMaxAperture : result := ‘PropertyTagExifMaxAperture’;
PropertyTagExifSubjectDist : result := ‘PropertyTagExifSubjectDist’;
PropertyTagExifMeteringMode : result := ‘PropertyTagExifMeteringMode’;
PropertyTagExifLightSource : result := ‘PropertyTagExifLightSource’;
PropertyTagExifFlash : result := ‘PropertyTagExifFlash’;
PropertyTagExifFocalLength : result := ‘PropertyTagExifFocalLength’;
PropertyTagExifMakerNote : result := ‘PropertyTagExifMakerNote’;
PropertyTagExifUserComment : result := ‘PropertyTagExifUserComment’;
PropertyTagExifDTSubsec : result := ‘PropertyTagExifDTSubsec’;
PropertyTagExifDTOrigSS : result := ‘PropertyTagExifDTOrigSS’;
PropertyTagExifDTDigSS : result := ‘PropertyTagExifDTDigSS’;
PropertyTagExifFPXVer : result := ‘PropertyTagExifFPXVer’;
PropertyTagExifColorSpace : result := ‘PropertyTagExifColorSpace’;
PropertyTagExifPixXDim : result := ‘PropertyTagExifPixXDim’;
PropertyTagExifPixYDim : result := ‘PropertyTagExifPixYDim’;
PropertyTagExifRelatedWav : result := ‘PropertyTagExifRelatedWav’;
PropertyTagExifInterop : result := ‘PropertyTagExifInterop’;
PropertyTagExifFlashEnergy : result := ‘PropertyTagExifFlashEnergy’;
PropertyTagExifSpatialFR : result := ‘PropertyTagExifSpatialFR’;
PropertyTagExifFocalXRes : result := ‘PropertyTagExifFocalXRes’;
PropertyTagExifFocalYRes : result := ‘PropertyTagExifFocalYRes’;
PropertyTagExifFocalResUnit : result := ‘PropertyTagExifFocalResUnit’;
PropertyTagExifSubjectLoc : result := ‘PropertyTagExifSubjectLoc’;
PropertyTagExifExposureIndex : result := ‘PropertyTagExifExposureIndex’;
PropertyTagExifSensingMethod : result := ‘PropertyTagExifSensingMethod’;
PropertyTagExifFileSource : result := ‘PropertyTagExifFileSource’;
PropertyTagExifSceneType : result := ‘PropertyTagExifSceneType’;
PropertyTagExifCfaPattern : result := ‘PropertyTagExifCfaPattern’;
PropertyTagGpsVer : result := ‘PropertyTagGpsVer’;
PropertyTagGpsLatitudeRef : result := ‘PropertyTagGpsLatitudeRef’;
PropertyTagGpsLatitude : result := ‘PropertyTagGpsLatitude’;
PropertyTagGpsLongitudeRef : result := ‘PropertyTagGpsLongitudeRef’;
PropertyTagGpsLongitude : result := ‘PropertyTagGpsLongitude’;
PropertyTagGpsAltitudeRef : result := ‘PropertyTagGpsAltitudeRef’;
PropertyTagGpsAltitude : result := ‘PropertyTagGpsAltitude’;
PropertyTagGpsGpsTime : result := ‘PropertyTagGpsGpsTime’;
PropertyTagGpsGpsSatellites : result := ‘PropertyTagGpsGpsSatellites’;
PropertyTagGpsGpsStatus : result := ‘PropertyTagGpsGpsStatus’;
PropertyTagGpsGpsMeasureMode : result := ‘PropertyTagGpsGpsMeasureMode’;
PropertyTagGpsGpsDop : result := ‘PropertyTagGpsGpsDop’;
PropertyTagGpsSpeedRef : result := ‘PropertyTagGpsSpeedRef’;
PropertyTagGpsSpeed : result := ‘PropertyTagGpsSpeed’;
PropertyTagGpsTrackRef : result := ‘PropertyTagGpsTrackRef’;
PropertyTagGpsTrack : result := ‘PropertyTagGpsTrack’;
PropertyTagGpsImgDirRef : result := ‘PropertyTagGpsImgDirRef’;
PropertyTagGpsImgDir : result := ‘PropertyTagGpsImgDir’;
PropertyTagGpsMapDatum : result := ‘PropertyTagGpsMapDatum’;
PropertyTagGpsDestLatRef : result := ‘PropertyTagGpsDestLatRef’;
PropertyTagGpsDestLat : result := ‘PropertyTagGpsDestLat’;
PropertyTagGpsDestLongRef : result := ‘PropertyTagGpsDestLongRef’;
PropertyTagGpsDestLong : result := ‘PropertyTagGpsDestLong’;
PropertyTagGpsDestBearRef : result := ‘PropertyTagGpsDestBearRef’;
PropertyTagGpsDestBear : result := ‘PropertyTagGpsDestBear’;
PropertyTagGpsDestDistRef : result := ‘PropertyTagGpsDestDistRef’;
PropertyTagGpsDestDist : result := ‘PropertyTagGpsDestDist’;
else
result := ‘’;
end;
end;

function GetEncoderClsid(format: String; out pClsid: TGUID): integer;
var
num, size, j: UINT;
ImageCodecInfo: PImageCodecInfo;
Type
ArrIMgInf = array of TImageCodecInfo;
begin
num := 0; // number of image encoders
size := 0; // size of the image encoder array in bytes
result := -1;

GetImageEncodersSize(num, size);
if (size = 0) then exit;

GetMem(ImageCodecInfo, size);
if(ImageCodecInfo = nil) then exit;

GetImageEncoders(num, size, ImageCodecInfo);

for j := 0 to num - 1 do
begin
if( ArrIMgInf(ImageCodecInfo)[j].MimeType = format) then
begin
pClsid := ArrIMgInf(ImageCodecInfo)[j].Clsid;
result := j; // Success
end;
end;
FreeMem(ImageCodecInfo, size);
end;

function GetStatus(Stat: TStatus): string;
begin
case Stat of
Ok : result := ‘Ok’;
GenericError : result := ‘GenericError’;
InvalidParameter : result := ‘InvalidParameter’;
OutOfMemory : result := ‘OutOfMemory’;
ObjectBusy : result := ‘ObjectBusy’;
InsufficientBuffer : result := ‘InsufficientBuffer’;
NotImplemented : result := ‘NotImplemented’;
Win32Error : result := ‘Win32Error’;
WrongState : result := ‘WrongState’;
Aborted : result := ‘Aborted’;
FileNotFound : result := ‘FileNotFound’;
ValueOverflow : result := ‘ValueOverflow’;
AccessDenied : result := ‘AccessDenied’;
UnknownImageFormat : result := ‘UnknownImageFormat’;
FontFamilyNotFound : result := ‘FontFamilyNotFound’;
FontStyleNotFound : result := ‘FontStyleNotFound’;
NotTrueTypeFont : result := ‘NotTrueTypeFont’;
UnsupportedGdiplusVersion : result := ‘UnsupportedGdiplusVersion’;
GdiplusNotInitialized : result := ‘GdiplusNotInitialized’;
PropertyNotFound : result := ‘PropertyNotFound’;
PropertyNotSupported : result := ‘PropertyNotSupported’;
else
result := ‘’;
end;
end;

function PixelFormatString(PixelFormat: TPixelFormat): string;
begin
case PixelFormat of
PixelFormatIndexed : result := ‘PixelFormatIndexed’;
PixelFormatGDI : result := ‘PixelFormatGDI’;
PixelFormatAlpha : result := ‘PixelFormatAlpha’;
PixelFormatPAlpha : result := ‘PixelFormatPAlpha’;
PixelFormatExtended : result := ‘PixelFormatExtended’;
PixelFormatCanonical : result := ‘PixelFormatCanonical’;
PixelFormatUndefined : result := ‘PixelFormatUndefined’;
PixelFormat1bppIndexed : result := ‘PixelFormat1bppIndexed’;
PixelFormat4bppIndexed : result := ‘PixelFormat4bppIndexed’;
PixelFormat8bppIndexed : result := ‘PixelFormat8bppIndexed’;
PixelFormat16bppGrayScale : result := ‘PixelFormat16bppGrayScale’;
PixelFormat16bppRGB555 : result := ‘PixelFormat16bppRGB555’;
PixelFormat16bppRGB565 : result := ‘PixelFormat16bppRGB565’;
PixelFormat16bppARGB1555 : result := ‘PixelFormat16bppARGB1555’;
PixelFormat24bppRGB : result := ‘PixelFormat24bppRGB’;
PixelFormat32bppRGB : result := ‘PixelFormat32bppRGB’;
PixelFormat32bppARGB : result := ‘PixelFormat32bppARGB’;
PixelFormat32bppPARGB : result := ‘PixelFormat32bppPARGB’;
PixelFormat48bppRGB : result := ‘PixelFormat48bppRGB’;
PixelFormat64bppARGB : result := ‘PixelFormat64bppARGB’;
PixelFormat64bppPARGB : result := ‘PixelFormat64bppPARGB’;
PixelFormatMax : result := ‘PixelFormatMax’;
else
result := ‘’;
end;
end;

function MakeLangID(PrimaryLanguage, SubLanguage: LANGID): Word;
begin
result := (SubLanguage shl 10) or PrimaryLanguage;
end;

GDIPOBJ.pas
unit GDIPOBJ;

interface
uses
Windows,
ActiveX,
GDIPAPI;

(**************************************************************************
*

  • GDI+ Codec Image APIs

**************************************************************************)

//--------------------------------------------------------------------------
// Codec Management APIs
//--------------------------------------------------------------------------

function GetImageDecodersSize(out numDecoders, size: UINT): TStatus;
function GetImageDecoders(numDecoders, size: UINT;
decoders: PImageCodecInfo): TStatus;
function GetImageEncodersSize(out numEncoders, size: UINT): TStatus;
function GetImageEncoders(numEncoders, size: UINT;
encoders: PImageCodecInfo): TStatus;

(**************************************************************************
*

  • Private GDI+ header file.

**************************************************************************)

//---------------------------------------------------------------------------
// GDI+ classes for forward reference
//---------------------------------------------------------------------------

type
TGPGraphics = class;
TGPPen = class;
TGPBrush = class;
TGPMatrix = class;
TGPBitmap = class;
TGPMetafile = class;
TGPFontFamily = class;
TGPGraphicsPath = class;
TGPRegion = class;
TGPImage = class;
TGPHatchBrush = class;
TGPSolidBrush = class;
TGPLinearGradientBrush = class;
TGPPathGradientBrush = class;
TGPFont = class;
TGPFontCollection = class;
TGPInstalledFontCollection = class;
TGPPrivateFontCollection = class;
TGPImageAttributes = class;
TGPCachedBitmap = class;

(**************************************************************************
*

  • GDI+ Region, Font, Image, CustomLineCap class definitions.

**************************************************************************)

TGPRegion = class(TGdiplusBase)
protected
nativeRegion: GpRegion;
lastResult: TStatus;
function SetStatus(status: TStatus): TStatus;
procedure SetNativeRegion(nativeRegion: GpRegion);
constructor Create(nativeRegion: GpRegion); reintroduce; overload;
public
constructor Create; reintroduce; overload;
constructor Create(rect: TGPRectF); reintroduce; overload;
constructor Create(rect: TGPRect); reintroduce; overload;
constructor Create(path: TGPGraphicsPath); reintroduce; overload;
constructor Create(regionData: PBYTE; size: Integer); reintroduce; overload;
constructor Create(hRgn: HRGN); reintroduce; overload;
function FromHRGN(hRgn: HRGN): TGPRegion;
destructor Destroy; override;
function Clone: TGPRegion;
function MakeInfinite: TStatus;
function MakeEmpty: TStatus;
function GetDataSize: UINT;
// buffer - where to put the data
// bufferSize - how big the buffer is (should be at least as big as GetDataSize())
// sizeFilled - if not NULL, this is an OUT param that says how many bytes
// of data were written to the buffer.
function GetData(buffer: PBYTE; bufferSize: UINT;
sizeFilled: PUINT = nil): TStatus;
function Intersect(const rect: TGPRect): TStatus; overload;
function Intersect(const rect: TGPRectF): TStatus; overload;
function Intersect(path: TGPGraphicsPath): TStatus; overload;
function Intersect(region: TGPRegion): TStatus; overload;
function Union(const rect: TGPRect): TStatus; overload;
function Union(const rect: TGPRectF): TStatus; overload;
function Union(path: TGPGraphicsPath): TStatus; overload;
function Union(region: TGPRegion): TStatus; overload;
function Xor_(const rect: TGPRect): TStatus; overload;
function Xor_(const rect: TGPRectF): TStatus; overload;
function Xor_(path: TGPGraphicsPath): TStatus; overload;
function Xor_(region: TGPRegion): TStatus; overload;
function Exclude(const rect: TGPRect): TStatus; overload;
function Exclude(const rect: TGPRectF): TStatus; overload;
function Exclude(path: TGPGraphicsPath): TStatus; overload;
function Exclude(region: TGPRegion): TStatus; overload;
function Complement(const rect: TGPRect): TStatus; overload;
function Complement(const rect: TGPRectF): TStatus; overload;
function Complement(path: TGPGraphicsPath): TStatus; overload;
function Complement(region: TGPRegion): TStatus; overload;
function Translate(dx, dy: Single): TStatus; overload;
function Translate(dx, dy: Integer): TStatus; overload;
function Transform(matrix: TGPMatrix): TStatus;
function GetBounds(out rect: TGPRect; g: TGPGraphics): TStatus; overload;
function GetBounds(out rect: TGPRectF; g: TGPGraphics): TStatus; overload;
function GetHRGN(g: TGPGraphics): HRGN;
function IsEmpty(g: TGPGraphics): BOOL;
function IsInfinite(g: TGPGraphics): BOOL ;
function IsVisible(x, y: Integer; g: TGPGraphics = nil): BOOL; overload;
function IsVisible(const point: TGPPoint; g: TGPGraphics = nil): BOOL; overload;
function IsVisible(x, y: Single; g: TGPGraphics = nil): BOOL; overload;
function IsVisible(const point: TGPPointF; g: TGPGraphics = nil): BOOL; overload;
function IsVisible(x, y, width, height: Integer; g: TGPGraphics): BOOL; overload;
function IsVisible(const rect: TGPRect; g: TGPGraphics = nil): BOOL; overload;
function IsVisible(x, y, width, height: Single; g: TGPGraphics = nil): BOOL; overload;
function IsVisible(const rect: TGPRectF; g: TGPGraphics = nil): BOOL; overload;
function Equals(region: TGPRegion; g: TGPGraphics): BOOL;
function GetRegionScansCount(matrix: TGPMatrix): UINT;
function GetRegionScans(matrix: TGPMatrix ;rects: PGPRectF; out count: Integer): TStatus; overload;
function GetRegionScans(matrix: TGPMatrix; rects: PGPRect; out count: Integer): TStatus; overload;
function GetLastStatus: TStatus;
end;

//--------------------------------------------------------------------------
// FontFamily
//--------------------------------------------------------------------------

TGPFontFamily = class(TGdiplusBase)
protected
nativeFamily: GpFontFamily;
lastResult: TStatus;
function SetStatus(status: TStatus): TStatus;
constructor Create(nativeOrig: GpFontFamily;
status: TStatus); reintroduce; overload;
public
constructor Create; reintroduce; overload;
constructor Create(name: WideString; fontCollection: TGPFontCollection = nil); reintroduce; overload;
destructor Destroy; override;
class function GenericSansSerif: TGPFontFamily;
class function GenericSerif: TGPFontFamily;
class function GenericMonospace: TGPFontFamily;
function GetFamilyName(out name: String; language: LANGID = 0): TStatus;
function Clone: TGPFontFamily;
function IsAvailable: BOOL;
function IsStyleAvailable(style: Integer): BOOL;
function GetEmHeight(style: Integer): UINT16;
function GetCellAscent(style: Integer): UINT16;
function GetCellDescent(style: Integer): UINT16;
function GetLineSpacing(style: Integer): UINT16;
function GetLastStatus: TStatus;
end;

//--------------------------------------------------------------------------
// Font Collection
//--------------------------------------------------------------------------

TGPFontCollection = class(TGdiplusBase)
protected
nativeFontCollection: GpFontCollection;
lastResult: TStatus;
function SetStatus(status: TStatus): TStatus;
public
constructor Create;
destructor Destroy; override;
function GetFamilyCount: Integer;
function GetFamilies(numSought: Integer; out gpfamilies: array of TGPFontFamily;
out numFound: Integer): TStatus;
function GetLastStatus: TStatus;
end;

TGPInstalledFontCollection = class(TGPFontCollection)
public
constructor Create; reintroduce;
destructor Destroy; override;
end;

TGPPrivateFontCollection = class(TGPFontCollection)
public
constructor Create; reintroduce;
destructor destroy; override;
function AddFontFile(filename: WideString): TStatus;
function AddMemoryFont(memory: Pointer; length: Integer): TStatus;
end;

//--------------------------------------------------------------------------
// TFont
//--------------------------------------------------------------------------

TGPFont = class(TGdiplusBase)
protected
nativeFont: GpFont;
lastResult: TStatus;
procedure SetNativeFont(Font: GpFont);
function SetStatus(status: TStatus): TStatus;
constructor Create(font: GpFont; status: TStatus); overload;
public
constructor Create(hdc: HDC); reintroduce; overload;
constructor Create(hdc: HDC; logfont: PLogFontA); reintroduce; overload;
constructor Create(hdc: HDC; logfont: PLogFontW); reintroduce; overload;
constructor Create(hdc: HDC; hfont: HFONT); reintroduce; overload;
constructor Create(family: TGPFontFamily; emSize: Single;
style: TFontStyle = FontStyleRegular;
unit_: TUnit = UnitPoint); reintroduce; overload;
constructor Create(familyName: WideString; emSize: Single;
style: TFontStyle = FontStyleRegular; unit_: TUnit = UnitPoint;
fontCollection: TGPFontCollection = nil); reintroduce; overload;
function GetLogFontA(g: TGPGraphics; out logfontA: TLogFontA): TStatus;
function GetLogFontW(g: TGPGraphics; out logfontW: TLogFontW): TStatus;
function Clone: TGPFont;
destructor Destroy; override;
function IsAvailable: BOOL;
function GetStyle: Integer;
function GetSize: Single;
function GetUnit: TUnit;
function GetLastStatus: TStatus;
function GetHeight(graphics: TGPGraphics): Single; overload;
function GetHeight(dpi: Single): Single; overload;
function GetFamily(family: TGPFontFamily): TStatus;
end;

//--------------------------------------------------------------------------
// Abstract base class for Image and Metafile
//--------------------------------------------------------------------------

TGPImage = class(TGdiplusBase)
protected
nativeImage: GpImage;
lastResult: TStatus;
loadStatus: TStatus;
procedure SetNativeImage(nativeImage: GpImage);
function SetStatus(status: TStatus): TStatus;
constructor Create(nativeImage: GpImage; status: TStatus); reintroduce; overload;
public
constructor Create(filename: WideString; useEmbeddedColorManagement: BOOL = FALSE); reintroduce; overload;
constructor Create(stream: IStream; useEmbeddedColorManagement: BOOL = FALSE); reintroduce; overload;
function FromFile(filename: WideString; useEmbeddedColorManagement: BOOL = FALSE): TGPImage;
function FromStream(stream: IStream; useEmbeddedColorManagement: BOOL = FALSE): TGPImage;
destructor destroy; override;
function Clone: TGPImage;
function Save(filename: WideString; const clsidEncoder: TGUID;
encoderParams: PEncoderParameters = nil): TStatus; overload;
function Save(stream: IStream; const clsidEncoder: TGUID;
encoderParams: PEncoderParameters = nil): TStatus; overload;
function SaveAdd(encoderParams: PEncoderParameters): TStatus; overload;
function SaveAdd(newImage: TGPImage; encoderParams: PEncoderParameters): TStatus; overload;
function GetType: TImageType;
function GetPhysicalDimension(out size: TGPSizeF): TStatus;
function GetBounds(out srcRect: TGPRectF; out srcUnit: TUnit): TStatus;
function GetWidth: UINT;
function GetHeight: UINT;
function GetHorizontalResolution: Single;
function GetVerticalResolution: Single;
function GetFlags: UINT;
function GetRawFormat(out format: TGUID): TStatus;
function GetPixelFormat: TPixelFormat;
function GetPaletteSize: Integer;
function GetPalette(palette: PColorPalette; size: Integer): TStatus;
function SetPalette(palette: PColorPalette): TStatus;
function GetThumbnailImage(thumbWidth, thumbHeight: UINT;
callback: GetThumbnailImageAbort = nil; callbackData: pointer = nil): TGPImage;
function GetFrameDimensionsCount: UINT;
function GetFrameDimensionsList(dimensionIDs: PGUID; count: UINT): TStatus;
function GetFrameCount(const dimensionID: TGUID): UINT;
function SelectActiveFrame(const dimensionID: TGUID; frameIndex: UINT): TStatus;
function RotateFlip(rotateFlipType: TRotateFlipType): TStatus;
function GetPropertyCount: UINT;
function GetPropertyIdList(numOfProperty: UINT; list: PPropID): TStatus;
function GetPropertyItemSize(propId: PROPID): UINT;
function GetPropertyItem(propId: PROPID; propSize: UINT; buffer: PPropertyItem): TStatus;
function GetPropertySize(out totalBufferSize, numProperties : UINT): TStatus;
function GetAllPropertyItems(totalBufferSize, numProperties: UINT;
allItems: PPROPERTYITEM): TStatus;
function RemovePropertyItem(propId: TPROPID): TStatus;
function SetPropertyItem(const item: TPropertyItem): TStatus;
function GetEncoderParameterListSize(const clsidEncoder: TGUID): UINT;
function GetEncoderParameterList(const clsidEncoder: TGUID; size: UINT;
buffer: PEncoderParameters): TStatus;
function GetLastStatus: TStatus;
end;

TGPBitmap = class(TGPImage)
protected
constructor Create(nativeBitmap: GpBitmap); reintroduce; overload;
public
constructor Create(filename: WideString; useEmbeddedColorManagement: BOOL = FALSE); reintroduce; overload;
constructor Create(stream: IStream; useEmbeddedColorManagement: BOOL = FALSE); reintroduce; overload;
function FromFile(filename: WideString; useEmbeddedColorManagement: BOOL = FALSE): TGPBitmap;
function FromStream(stream: IStream; useEmbeddedColorManagement: BOOL = FALSE): TGPBitmap;
constructor Create(width, height, stride: Integer; format: TPixelFormat; scan0: PBYTE); reintroduce; overload;
constructor Create(width, height: Integer; format: TPixelFormat = PixelFormat32bppARGB); reintroduce; overload;
constructor Create(width, height: Integer; target: TGPGraphics); reintroduce; overload;
function Clone(rect: TGPRect; format: TPixelFormat): TGPBitmap; overload;
function Clone(x, y, width, height: Integer; format: TPixelFormat): TGPBitmap; overload;
function Clone(rect: TGPRectF; format: TPixelFormat): TGPBitmap; overload;
function Clone(x, y, width, height: Single; format: TPixelFormat): TGPBitmap; overload;
function LockBits(rect: TGPRect; flags: UINT; format: TPixelFormat; out lockedBitmapData: TBitmapData): TStatus;
function UnlockBits(var lockedBitmapData: TBitmapData): TStatus;
function GetPixel(x, y: Integer; out color: TGPColor): TStatus;
function SetPixel(x, y: Integer; color: TGPColor): TStatus;
function SetResolution(xdpi, ydpi: Single): TStatus;
constructor Create(var gdiBitmapInfo: TBITMAPINFO; gdiBitmapData: Pointer); reintroduce; overload;
constructor Create(hbm: HBITMAP; hpal: HPALETTE); reintroduce; overload;
constructor Create(hicon: HICON); reintroduce; overload;
constructor Create(hInstance: HMODULE; bitmapName: WideString); reintroduce; overload;
function FromBITMAPINFO(var gdiBitmapInfo: TBITMAPINFO; gdiBitmapData: Pointer): TGPBitmap;
function FromHBITMAP(hbm: HBITMAP; hpal: HPALETTE): TGPBitmap;
function FromHICON(hicon: HICON): TGPBitmap;
function FromResource(hInstance: HMODULE; bitmapName: WideString): TGPBitmap;
function GetHBITMAP(colorBackground: TGPColor; out hbmReturn: HBITMAP): TStatus;
function GetHICON(out hicon: HICON): TStatus;
end;

TGPCustomLineCap = class(TGdiplusBase)
protected
nativeCap: GpCustomLineCap;
lastResult: TStatus;
procedure SetNativeCap(nativeCap: GpCustomLineCap);
function SetStatus(status: TStatus): TStatus;
constructor Create(nativeCap: GpCustomLineCap;
status: TStatus); reintroduce; overload;
public
constructor Create; reintroduce; overload;
constructor Create(fillPath, strokePath: TGPGraphicsPath;
baseCap: TLineCap = LineCapFlat;
baseInset: Single = 0); reintroduce; overload;
destructor Destroy; override;
function Clone: TGPCustomLineCap;
function SetStrokeCap(strokeCap: TLineCap): TStatus;
function SetStrokeCaps(startCap, endCap: TLineCap): TStatus;
function GetStrokeCaps(out startCap, endCap: TLineCap): TStatus;
function SetStrokeJoin(lineJoin: TLineJoin): TStatus;
function GetStrokeJoin: TLineJoin;
function SetBaseCap(baseCap: TLineCap): TStatus;
function GetBaseCap: TLineCap;
function SetBaseInset(inset: Single): TStatus;
function GetBaseInset: Single;
function SetWidthScale(widthScale: Single): TStatus;
function GetWidthScale: Single;
function GetLastStatus: TStatus;
end;

TGPCachedBitmap = class(TGdiplusBase)
protected
nativeCachedBitmap: GpCachedBitmap;
lastResult: TStatus;
public
constructor Create(bitmap: TGPBitmap; graphics: TGPGraphics); reintroduce;
destructor Destroy; override;
function GetLastStatus: TStatus;
end;

(**************************************************************************
*

  • GDI+ Image Attributes used with Graphics.DrawImage
  • There are 5 possible sets of color adjustments:
  •      ColorAdjustDefault,
    
  •      ColorAdjustBitmap,
    
  •      ColorAdjustBrush,
    
  •      ColorAdjustPen,
    
  •      ColorAdjustText,
    
  • Bitmaps, Brushes, Pens, and Text will all use any color adjustments
  • that have been set into the default ImageAttributes until their own
  • color adjustments have been set. So as soon as any “Set” method is
  • called for Bitmaps, Brushes, Pens, or Text, then they start from
  • scratch with only the color adjustments that have been set for them.
  • Calling Reset removes any individual color adjustments for a type
  • and makes it revert back to using all the default color adjustments
  • (if any). The SetToIdentity method is a way to force a type to
  • have no color adjustments at all, regardless of what previous adjustments
  • have been set for the defaults or for that type.

**************************************************************F)

TGPImageAttributes = class(TGdiplusBase)
protected
nativeImageAttr: GpImageAttributes;
lastResult: TStatus;
procedure SetNativeImageAttr(nativeImageAttr: GpImageAttributes);
function SetStatus(status: TStatus): TStatus;
constructor Create(imageAttr: GpImageAttributes;
status: GpStatus); reintroduce; overload;
public
constructor Create; reintroduce; overload;
destructor Destroy; override;
function Clone: TGPImageAttributes;
function SetToIdentity(type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function Reset(type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetColorMatrix(const colorMatrix: TColorMatrix;
mode: TColorMatrixFlags = ColorMatrixFlagsDefault;
type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function ClearColorMatrix(type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetColorMatrices(const colorMatrix: TColorMatrix; const grayMatrix: TColorMatrix;
mode: TColorMatrixFlags = ColorMatrixFlagsDefault;
type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function ClearColorMatrices(Type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetThreshold(threshold: Single; type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function ClearThreshold(type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetGamma(gamma: Single; type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function ClearGamma( type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetNoOp(type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function ClearNoOp(Type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetColorKey(colorLow, colorHigh: TGPColor; type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function ClearColorKey(type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetOutputChannel(channelFlags: TColorChannelFlags; type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function ClearOutputChannel(type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetOutputChannelColorProfile(colorProfileFilename: WideString;
type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function ClearOutputChannelColorProfile(type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetRemapTable(mapSize: Cardinal; map: PColorMap; type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function ClearRemapTable(type_: TColorAdjustType = ColorAdjustTypeDefault): TStatus;
function SetBrushRemapTable(mapSize: Cardinal; map: PColorMap): TStatus;
function ClearBrushRemapTable: TStatus;
function SetWrapMode(wrap: TWrapMode; color: TGPColor = aclBlack; clamp: BOOL = FALSE): TStatus;
// The flags of the palette are ignored.
function GetAdjustedPalette(colorPalette: PColorPalette; colorAdjustType: TColorAdjustType): TStatus;
function GetLastStatus: TStatus;
end;

(**************************************************************************
*

  • GDI+ Matrix class

**************************************************************************)

TMatrixArray = array[0…5] of Single;

TGPMatrix = class(TGdiplusBase)
protected
nativeMatrix: GpMatrix;
lastResult: GpStatus ;
procedure SetNativeMatrix(nativeMatrix: GpMatrix);
function SetStatus(status: GpStatus): TStatus;
constructor Create(nativeMatrix: GpMatrix); reintroduce; overload;
public
// Default constructor is set to identity matrix.
constructor Create; reintroduce; overload;
constructor Create(m11, m12, m21, m22, dx, dy: Single); reintroduce; overload;
constructor Create(const rect: TGPRectF; const dstplg: TGPPointF); reintroduce; overload;
constructor Create(const rect: TGPRect; const dstplg: TGPPoint); reintroduce; overload;
destructor Destroy; override;
function Clone: TGPMatrix;
function GetElements(const m: TMatrixArray): TStatus;
function SetElements(m11, m12, m21, m22, dx, dy: Single): TStatus;
function OffsetX: Single;
function OffsetY: Single;
function Reset: TStatus;
function Multiply(matrix: TGPMatrix; order: TMatrixOrder = MatrixOrderPrepend): TStatus; // ok
function Translate(offsetX, offsetY: Single; order: TMatrixOrder = MatrixOrderPrepend): TStatus; // ok
function Scale(scaleX, scaleY: Single; order: TMatrixOrder = MatrixOrderPrepend): TStatus; // ok
function Rotate(angle: Single; order: TMatrixOrder = MatrixOrderPrepend): TStatus; // ok
function RotateAt(angle: Single; const center: TGPPointF; order: TMatrixOrder = MatrixOrderPrepend): TStatus; // ok
function Shear(shearX, shearY: Single; order: TMatrixOrder = MatrixOrderPrepend): TStatus; // ok
function Invert: TStatus; // ok

function TransformPoints(pts: PGPPointF; count: Integer = 1): TStatus; overload;
function TransformPoints(pts: PGPPoint; count: Integer = 1): TStatus; overload;

function TransformVectors(pts: PGPPointF; count: Integer = 1): TStatus; overload;
function TransformVectors(pts: PGPPoint; count: Integer = 1): TStatus; overload;

function IsInvertible: BOOL;
function IsIdentity: BOOL;
function Equals(matrix: TGPMatrix): BOOL;
function GetLastStatus: TStatus;

end;

(**************************************************************************
*

  • GDI+ Brush class

**************************************************************************)

//--------------------------------------------------------------------------
// Abstract base class for various brush types
//--------------------------------------------------------------------------

TGPBrush = class(TGdiplusBase)
protected
nativeBrush: GpBrush;
lastResult: TStatus;
procedure SetNativeBrush(nativeBrush: GpBrush);
function SetStatus(status: TStatus): TStatus;
constructor Create(nativeBrush: GpBrush; status: TStatus); overload;
public
constructor Create; overload;
destructor Destroy; override;
function Clone: TGPBrush; virtual;
function GetType: TBrushType;
function GetLastStatus: TStatus;
end;

//--------------------------------------------------------------------------
// Solid Fill Brush Object
//--------------------------------------------------------------------------

TGPSolidBrush = class(TGPBrush)
public
constructor Create(color: TGPColor); reintroduce; overload;
constructor Create; reintroduce; overload;
function GetColor(out color: TGPColor): TStatus;
function SetColor(color: TGPColor): TStatus;
end;

//--------------------------------------------------------------------------
// Texture Brush Fill Object
//--------------------------------------------------------------------------

TGPTextureBrush = class(TGPBrush)
public
constructor Create(image: TGPImage; wrapMode: TWrapMode = WrapModeTile); reintroduce; overload;
constructor Create(image: TGPImage; wrapMode: TWrapMode; dstRect: TGPRectF); reintroduce; overload;
constructor Create(image: TGPImage; dstRect: TGPRectF; imageAttributes: TGPImageAttributes = nil); reintroduce; overload;
constructor Create(image: TGPImage; dstRect: TGPRect; imageAttributes: TGPImageAttributes = nil); reintroduce; overload;
constructor Create(image: TGPImage; wrapMode: TWrapMode; dstRect: TGPRect); reintroduce; overload;
constructor Create(image: TGPImage; wrapMode: TWrapMode; dstX, dstY, dstWidth,
dstHeight: Single); reintroduce; overload;
constructor Create(image: TGPImage; wrapMode: TWrapMode; dstX, dstY, dstWidth,
dstHeight: Integer); reintroduce; overload;
constructor Create; reintroduce; overload;
function SetTransform(matrix: TGPMatrix): TStatus;
function GetTransform(matrix: TGPMatrix): TStatus;
function ResetTransform: TStatus;
function MultiplyTransform(matrix: TGPMatrix; order: TMatrixOrder = MatrixOrderPrepend): TStatus;
function TranslateTransform(dx, dy: Single; order: MatrixOrder = MatrixOrderPrepend): TStatus;
function ScaleTransform(sx, sy: Single; order: TMatrixOrder = MatrixOrderPrepend): TStatus;
function RotateTransform(angle: Single; order: TMatrixOrder = MatrixOrderPrepend): TStatus;
function SetWrapMode(wrapMode: TWrapMode): TStatus;
function GetWrapMode: TWrapMode;
function GetImage: TGPImage;
end;

//--------------------------------------------------------------------------
// Linear Gradient Brush Object
//-----------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大龙软件研发

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值