Смотрел там сильно медлено. 254 тиков против 15 на scanline
Но я надыбал способ побыстрее, где-то 15-16 тиков
- Код: Выделить всё
- type
 PBGRPixel = ^TBGRPixel;
 
 TBGRPixel = packed record
 blue, green, red: byte;
 end;
 
 ...............
 
 
 
 
 procedure TForm1.Button1Click(Sender: TObject);
 var
 bitmap: Tbitmap;
 a, b:   integer;
 begin
 
 a      := GetTickCount;
 bitmap := Tbitmap.Create;
 bitmap.Width := 1000;
 Bitmap.Height := 1000;
 
 
 Test(bitmap);
 canvas.Draw(0, 0, bitmap);
 
 bitmap.Free;
 b := GetTickCount;
 ShowMessage(IntToStr(b - a));
 end;
 
 
 
 procedure TForm1.Test(var FBitmap: TBitMap);
 
 var
 y: integer;
 RawImage: TRawImage;
 BitmapHandle, MaskHandle: HBitmap;
 FData, FFdata: PBGRPixel;
 begin
 ReAllocMem(FData, FBitmap.Width * FBitmap.Height * sizeof(TBGRPixel));
 FFdata := FData;
 /////////////////////////////Здесь можем рисовать
 for y := 0 to FBitmap.Height*fbitmap.Width-1 do
 begin
 FFdata^.red   := 0;
 FFdata^.Green := 0;
 FFdata^.Blue  := 255;
 Inc(FFdata);
 end;
 
 if (FBitmap.Width > 0) and (FBitmap.Height > 0) then
 begin
 RawImage.Init;
 RawImage.Description.Init_BPP24_B8G8R8_BIO_TTB(FBitmap.Width, FBitmap.Height);
 RawImage.Description.LineOrder := riloBottomToTop;
 RawImage.Data     := PByte(FData);
 RawImage.DataSize := FBitmap.Width * FBitmap.Height * sizeof(TBGRPixel);
 if not RawImage_CreateBitmaps(RawImage, BitmapHandle, MaskHandle, False) then
 raise FPImageException.Create('Failed to create bitmap handle');
 FBitmap.Handle     := BitmapHandle;
 FBitmap.MaskHandle := MaskHandle;
 end;
 
 FBitmap.Canvas.AntialiasingMode := amOff;
 freemem(FData);
 FData := nil;
 end;
юниты
 GraphType, LCLIntf, FPimage