- Timestamp:
- May 9, 2020, 4:02:07 PM (5 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/CevoComponents/UPixelPointer.pas
r209 r210 1 unit PixelPointer;1 unit UPixelPointer; 2 2 3 3 interface 4 4 5 5 uses 6 Classes, SysUtils, Graphics;6 UDpiControls, Classes, SysUtils, Graphics; 7 7 8 8 type … … 31 31 procedure SetXY(X, Y: Integer); inline; // Set pixel position relative to base 32 32 procedure SetX(X: Integer); inline; // Set horizontal pixel position relative to base 33 procedure Init(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0); inline;34 33 end; 35 34 PPixelPointer = ^TPixelPointer; 35 36 function PixelPointer(Bitmap: TDpiRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline; 36 37 37 38 … … 62 63 end; 63 64 64 procedure TPixelPointer.Init(Bitmap: TRasterImage; BaseX: Integer = 0;65 BaseY: Integer = 0); inline;65 function PixelPointer(Bitmap: TDpiRasterImage; BaseX: Integer; 66 BaseY: Integer): TPixelPointer; 66 67 begin 67 BytesPerLine := Bitmap.RawImage.Description.BytesPerLine; 68 BytesPerPixel := Bitmap.RawImage.Description.BitsPerPixel shr 3; 69 Base := PPixel32(Bitmap.RawImage.Data + BaseX * BytesPerPixel + BaseY * BytesPerLine); 70 SetXY(0, 0); 68 Result.BytesPerLine := Bitmap.RawImage.Description.BytesPerLine; 69 Result.BytesPerPixel := Bitmap.RawImage.Description.BitsPerPixel shr 3; 70 Result.Base := PPixel32(Bitmap.RawImage.Data + BaseX * Result.BytesPerPixel + 71 BaseY * Result.BytesPerLine); 72 Result.SetXY(0, 0); 71 73 end; 72 74
Note:
See TracChangeset
for help on using the changeset viewer.