![]() |
GDI Plus
Kennt sich wer mit GDI Plus aus ?
Möchte gerne eine Metafile reinladen, und dann mit den Antialising sachen (Text Antialiasd, Smoothing bei Linien, TextContrast ... ) zeichnen
Delphi-Quellcode:
funktioniert leider nicht (es wird zwar gezeichnet, aber die Rendering einstellungen sind egal)
fGraphics := TGPGraphics.Create(x.Canvas.Handle);
if cbAA.Checked then begin fGraphics.SetTextRenderingHint(TextRenderingHintAntiAlias); fGraphics.SetSmoothingMode(SmoothingModeHighQuality); fGraphics.SetTextContrast(9); fGraphics.SetCompositingQuality(CompositingQualityHighQuality) end; thisTick := GetTickCount; // fGraphics.EnumerateMetafile(GDIMetaFile, MakeRect(toRect.Left, toREct.Top, toRect.Right, toRect.Bottom), metaCallback, GDIMetaFile); fGraphics.DrawImage(GDIMetaFile, MakeRect(toRect.Left, toREct.Top, toRect.Right, toRect.Bottom) ); tick2 := GetTickCount; fGraphics.Free; zum Testen habe ich dann noch folgendes probier
Delphi-Quellcode:
Es wird die Callback funktion aufgerufen (habe zum Testen mal die TextOut nicht weitergeleitet) aber auch dort funktionieren die Einstellungen nicht.
function metaCallback(recordType : TEmfPlusRecordType; flags : UINT; dataSize : UINT; data : PBYTE; callbackData : pointer) : BOOL; stdcall;
begin fGraphics.SetTextRenderingHint(TextRenderingHintAntiAliasGridFit); fGraphics.SetSmoothingMode(SmoothingModeHighQuality); fGraphics.SetTextContrast(9); fGraphics.SetCompositingQuality(CompositingQualityHighQuality); // if (recordType <> EmfRecordTypeExtTextOutW) then begin TGPMetafile(callbackData).PlayRecord(recordType, flags, dataSize, Data); end; result := TRUE; end; fGraphics.EnumerateMetafile(GDIMetaFile, MakeRect(toRect.Left, toREct.Top, toRect.Right, toRect.Bottom), metaCallback, GDIMetaFile); |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:14 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz