Thema: Delphi Help with Graphics32

Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#3

Re: Help with Graphics32

  Alt 19. Jan 2010, 18:17
Q1 is solved. This is more simple I thought! Must handle layer OnPain event, like this:
Delphi-Quellcode:
var
  DstRect: TFloatRect;
  R: TRect;
  B: TBitmap32;
begin
  with TPositionedLayer(Sender) do
  begin
    DstRect := GetAdjustedLocation;
    R := MakeRect(DstRect);

    if not Buffer.MeasuringMode then
    begin
      B := TBitmap32.Create;
      try
        B.SetSize(...); // size = layer size of course
        B.Canvas.CopyRect(...); // here copy from buffer

        // Image processing here

        B.DrawTo(Buffer, R); // Now can display
      finally
        B.Free;
      end;
    end;
    Buffer.Changed;
  end;
end;
Q2: Looka at this image (fragment of 1600x1200 image in scale 1:1):
http://i50.tinypic.com/1588boy.png
Edge should be smooth.
  Mit Zitat antworten Zitat