never tested it, but i made a function for you.
where the bitmap has to be already declared, as in
bitmap := BitmapFromString(100, 100, ''); or a previously used bitmap;
it copys part of the canvas on how big the bitmap is.
the most reasonable way of drawing without needing to use this function is
u draw on a bitmap, and once your done, you draw the bitmap on the canvas
to draw on a bitmap the most easy technique is fastsetpixel or GetBitmapCanvas(bitmap);
anyways
SCAR Code:
function CanvasToBitmap(var Bitmap : integer; Canvas : TCanvas) : boolean;
var
w, h : integer;
begin
try
GetBitmapSize(Bitmap, w, h);
SafeCopyCanvas(Canvas, GetBitmapCanvas(Bitmap), 0, 0, w, h, 0, 0, w, h);
Result := True;
except
Writeln('[Runtime Error] In CanvasToBitmap, probally bitmap or canvas does not exist!!');
end;
end;