Changeset 34


Ignore:
Timestamp:
Jan 11, 2018, 4:43:35 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Drawing pixmap to TBitmap.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/FastGraphics/UGGraphics.pas

    r33 r34  
    213213    PixelPtrMin := PixelRowPtr;
    214214    PixelPtrMax := PixelRowPtr + RawImage.Description.Width * RawImage.Description.Height * BytePerPixel;
    215     for Y := Rect.Top to Rect.Bottom - 1 do begin
     215    for Y := 0 to Bitmap.Height - 1 do begin
    216216      PixelPtr := PixelRowPtr;
    217       for X := Rect.Left to Rect.Right - 1 do begin
    218         if (X >= 0) and (X < FSize.X) and (Y >= 0) and (Y < FSize.Y) and
     217      for X := 0 to Bitmap.Width - 1 do begin
     218        if ((X + Rect.Left) >= 0) and ((X + Rect.Left) < FSize.X) and
     219        ((Y + Rect.Top) >= 0) and ((Y + Rect.Top) < FSize.Y) and
    219220        (PixelPtr < PixelPtrMax) and (PixelPtr >= PixelPtrMin) then begin
    220           PixelPtr^ := ColorConvertFunc(Pixels[X, Y]);
     221          PixelPtr^ := ColorConvertFunc(Pixels[X + Rect.Left, Y + Rect.Top]);
    221222        end;
    222223        Inc(PByte(PixelPtr), BytePerPixel);
Note: See TracChangeset for help on using the changeset viewer.