AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi Cannot Assign TBitmapCanvas to TBitmapCanvas
Thema durchsuchen
Ansicht
Themen-Optionen

Cannot Assign TBitmapCanvas to TBitmapCanvas

Ein Thema von sk.Silvia · begonnen am 26. Feb 2006 · letzter Beitrag vom 27. Feb 2006
 
marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#7

Re: Cannot Assign TBitmapCanvas to TBitmapCanvas

  Alt 26. Feb 2006, 20:50
Your choice of variable names confused me. Screen is a well known VCL management object and has no canvas property. It seems you have two bitmaps - one to hold a full image and one to hold an arbitrary rect cut out of the full image. CopyRect would be my choice to accomplish this. The code for ClipButtonClick is my test code:

Delphi-Quellcode:
procedure GetViewPort(bmFull, bmPart: TBitmap; TopLeft: TPoint);
var
  r: TRect;
begin
  with bmPart do
    r := Bounds(TopLeft.X, TopLeft.Y, Width, Height);
  with bmPart.Canvas do
    CopyRect(ClipRect, bmFull.Canvas, r);
end;

procedure TDemoForm.ClipButtonClick(Sender: TObject);
var
  bmFull: TBitMap;
begin
  bmFull := GrabImage(GetDesktopWindow);
  with Image.Picture.Bitmap do
  begin
    Width := Image.Width;
    Height := Image.Height;
  end;
  GetViewPort(bmFull, Image.Picture.Bitmap, Point(100, 100));
  bmFull.Free;
end;
marabu
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:32 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