Changeset 203 for GraphicTest/UDrawMethod.pas
- Timestamp:
- Mar 17, 2011, 9:49:34 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/UDrawMethod.pas
r202 r203 193 193 Y, X: Integer; 194 194 PixelPtr: PInteger; 195 RowPtr: PInteger; 195 196 P: TPixelFormat; 196 197 RawImage: TRawImage; 197 198 BytePerPixel: Integer; 199 BytePerRow: Integer; 198 200 begin 199 201 P := Bitmap.PixelFormat; … … 202 204 Bitmap.BeginUpdate(False); 203 205 RawImage := Bitmap.RawImage; 204 PixelPtr := PInteger(RawImage.Data);206 RowPtr := PInteger(RawImage.Data); 205 207 BytePerPixel := RawImage.Description.BitsPerPixel div 8; 206 for X := 0 to Size.X - 1 do 207 for Y := 0 to Size.Y - 1 do begin 208 BytePerRow := RawImage.Description.BytesPerLine; 209 for Y := 0 to Size.Y - 1 do begin 210 PixelPtr := RowPtr; 211 for X := 0 to Size.X - 1 do begin 208 212 PixelPtr^ := Pixels[X, Y] * $010101; 209 213 Inc(PByte(PixelPtr), BytePerPixel); 210 214 end; 215 Inc(PByte(RowPtr), BytePerRow); 216 end; 211 217 finally 212 218 Bitmap.EndUpdate(False);
Note:
See TracChangeset
for help on using the changeset viewer.