Forum > General
Rgb to bmp
(1/1)
mrdebug:
How can I fast translate a rgb image in bmp or jpeg format?
Zaher:
--- Code: ---var
aBmpPic: TBitmap;
aJpgPic: TJPEGImage;
begin
aBmpPic := TBitmap.Create;
aJpgPic := TJPEGImage.Create;
aBmpPic.LoadFromFile('c:\1.bmp');
aJpgPic.Assign(aBmpPic);
aJpgPic.SaveToFile('c:\2.jpg');
end;
--- End code ---
mrdebug:
Le me explain. I have an array of LongWord that represents an image in rgb format. To get a bmp image I must do this:
--- Code: ---...
TBMImage.Canvas.Pixels[X, Y]:= ...
...
--- End code ---
but it is very slow! WHat can I do to get the traslation so much fast?
theo:
http://wiki.lazarus.freepascal.org/Developing_with_Graphics
mrdebug:
Thanks for the link.
How can I obtain a jpeg image from TRGB32Bitmap object?
aJpgPic.Assign(RGB32Bitmap) does nt work.
Navigation
[0] Message Index