Einzelnen Beitrag anzeigen

venice2
(Gast)

n/a Beiträge
 
#1

PatBlt, Bereich vom Bitmap

  Alt 2. Nov 2020, 15:31
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;

Geändert von venice2 ( 2. Nov 2020 um 16:34 Uhr)
  Mit Zitat antworten Zitat