Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi GDI Plus (https://www.delphipraxis.net/40541-gdi-plus.html)

Gruber_Hans_12345 17. Feb 2005 11:29


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:
        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;
funktioniert leider nicht (es wird zwar gezeichnet, aber die Rendering einstellungen sind egal)

zum Testen habe ich dann noch folgendes probier

Delphi-Quellcode:
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);
Es wird die Callback funktion aufgerufen (habe zum Testen mal die TextOut nicht weitergeleitet) aber auch dort funktionieren die Einstellungen nicht.


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:54 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz