Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi PatBlt, Bereich vom Bitmap (https://www.delphipraxis.net/205944-patblt-bereich-vom-bitmap.html)

venice2 2. Nov 2020 15:31


PatBlt, Bereich vom Bitmap
 
Ich möchte einen bereich aus einem Bitmap mit PatBlt in ein Edit Control kopieren.
Leider funktioniert es nicht.

Egal welche Koordinaten ich angebe es wir immer falsch gezeichnet.
Kann PatBlt keinen bereich aus dem Bitmap übergeben? (sollte eigentlich funktionieren)

Zitat:

The PatBlt function paints the specified rectangle using the brush that is currently selected into the specified device context. The brush color and the surface color or colors are combined by using the specified raster operation.
Warum geht es dann nicht?

Delphi-Quellcode:
    WM_CTLCOLOREDIT:
      begin
        if hBrushBack = 0 then
          hBrushBack := CreatePatternBrush(SkinEngine.GetBackBitmap(InputHandle));

        SetTextColor(HDC(wP), RGB(255, 255, 255));
        SetBkMode(HDC(wP), TRANSPARENT);

        Brush := hBrushBack;

        hOldBrush := SelectObject(HDC(wP), Brush);
        PatBlt(HDC(wP), 25, 85, 300, 18, PATCOPY);
        SelectObject(HDC(wP), hOldBrush);

        Result := Brush;
        Exit;
      end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:18 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-2025 by Thomas Breitkreuz