Changeset 19 for trunk/Forms
- Timestamp:
- Jan 21, 2018, 11:33:15 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r18 r19 200 200 SizeY: Integer; 201 201 begin 202 { var203 X, Y: Integer;204 PixelPtr: PInteger;205 PixelRowPtr: PInteger;206 RawImage: TRawImage;207 BytePerPixel: Integer;208 SourcePixelPtr: Integer;209 begin210 try211 Bitmap.BeginUpdate;212 RawImage := Bitmap.RawImage;213 PixelRowPtr := PInteger(RawImage.Data);214 BytePerPixel := RawImage.Description.BitsPerPixel div 8;215 for Y := 0 to Bitmap.Height - 1 do begin216 PixelPtr := PixelRowPtr;217 for X := 0 to Bitmap.Width - 1 do begin218 SourcePixelPtr := TMatter(Matter[Surface.ItemsXY[Trunc(X / Bitmap.Width * Surface.Count.X),219 Trunc(Y / Bitmap.Height * Surface.Count.Y)]]).Color;220 PixelPtr^ := SwapBRComponent(SourcePixelPtr);221 Inc(PByte(PixelPtr), BytePerPixel);222 end;223 Inc(PByte(PixelRowPtr), RawImage.Description.BytesPerLine);224 end;225 finally226 Bitmap.EndUpdate;227 end;228 }229 202 try 230 203 TempBitmap.SetSize(VideoDevice.VideoMode.Size.X, VideoDevice.VideoMode.Size.Y); … … 234 207 DestBytePerPixel := RawImage.Description.BitsPerPixel div 8; 235 208 DestBytePerLine := RawImage.Description.BytesPerLine; 209 VideoDevice.Lock.Acquire; 236 210 if Assigned(VideoDevice.VideoMemory) then begin 237 211 SourceBytePerPixel := VideoDevice.VideoMode.GetBytesPerPixel; … … 252 226 end; 253 227 end; 228 VideoDevice.Lock.Release; 254 229 finally 255 230 TempBitmap.EndUpdate; … … 266 241 VideoMode.Size := TPoint.Create(Width, Height); 267 242 VideoDevice.VideoMode := VideoMode; 243 VideoMode.Free; 268 244 end; 269 245
Note:
See TracChangeset
for help on using the changeset viewer.