Changeset 538 for trunk/Packages/DpiControls/NativePixelPointer.pas
- Timestamp:
- Apr 16, 2024, 10:57:39 AM (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/DpiControls/NativePixelPointer.pas
r506 r538 63 63 procedure SetX(X: Integer); inline; // Set horizontal pixel position relative to base 64 64 procedure CheckRange; inline; // Check if current pixel position is not out of range 65 function PosValid: Boolean; 65 66 class function Create(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; static; 66 67 property PixelARGB: TColor32 read GetPixelARGB write SetPixelARGB; … … 93 94 94 95 resourcestring 95 SOutOfRange = 'Pixel pointer out of range [X: %d . Y: %d]';96 SOutOfRange = 'Pixel pointer out of range [X: %d, Y: %d, Width: %d, Height: %d]'; 96 97 SWrongBitmapSize = 'Wrong bitmap size [width: %d, height: %d]'; 97 98 … … 159 160 X := X - Y * BytesPerLine; 160 161 X := Floor(X / BytesPerPixel); 161 raise Exception.Create(Format(SOutOfRange, [X, Y ]));162 raise Exception.Create(Format(SOutOfRange, [X, Y, Width, Height])); 162 163 end; 163 164 {$ENDIF} 165 end; 166 167 function TPixelPointer.PosValid: Boolean; 168 begin 169 Result := not ((PByte(Pixel) < PByte(Data)) or 170 (PByte(Pixel) >= PByte(Data) + Height * BytesPerLine)); 164 171 end; 165 172
Note:
See TracChangeset
for help on using the changeset viewer.