Changeset 30 for trunk/Packages/FastGraphics/UGGraphics.pas
- Timestamp:
- Dec 23, 2016, 10:07:39 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/FastGraphics/UGGraphics.pas
r29 r30 199 199 PixelPtr: PInteger; 200 200 PixelPtrMax: PInteger; 201 PixelPtrMin: PInteger; 201 202 PixelRowPtr: PInteger; 202 203 P: TPixelFormat; … … 209 210 PixelRowPtr := PInteger(RawImage.Data); 210 211 BytePerPixel := RawImage.Description.BitsPerPixel div 8; 212 PixelPtrMin := PixelRowPtr; 211 213 PixelPtrMax := PixelRowPtr + RawImage.Description.Width * RawImage.Description.Height * BytePerPixel; 212 214 for Y := Rect.Top to Rect.Bottom - 1 do begin 213 215 PixelPtr := PixelRowPtr; 214 216 for X := Rect.Left to Rect.Right - 1 do begin 215 if (X >= 0) and (X < FSize.X) and (Y >= 0) and (Y < FSize.Y) and (PixelPtr < PixelPtrMax) then 217 if (X >= 0) and (X < FSize.X) and (Y >= 0) and (Y < FSize.Y) and 218 (PixelPtr < PixelPtrMax) and (PixelPtr > PixelPtrMin) then 216 219 PixelPtr^ := ColorConvertFunc(Pixels[X, Y]); 217 220 Inc(PByte(PixelPtr), BytePerPixel);
Note:
See TracChangeset
for help on using the changeset viewer.