Recent

Author Topic: Rgb to bmp  (Read 5884 times)

mrdebug

  • Full Member
  • ***
  • Posts: 160
Rgb to bmp
« on: April 23, 2010, 08:06:27 pm »
How can I fast translate a rgb image in bmp or jpeg format?

Zaher

  • Hero Member
  • *****
  • Posts: 683
    • parmaja.org
Re: Rgb to bmp
« Reply #1 on: April 23, 2010, 08:24:27 pm »
Code: [Select]
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;

mrdebug

  • Full Member
  • ***
  • Posts: 160
Re: Rgb to bmp
« Reply #2 on: April 24, 2010, 07:09:02 am »
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: [Select]
...
TBMImage.Canvas.Pixels[X, Y]:= ...
...

but it is very slow! WHat can I do to get the traslation so much fast?

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1946
Re: Rgb to bmp
« Reply #3 on: April 24, 2010, 08:33:53 am »

mrdebug

  • Full Member
  • ***
  • Posts: 160
Re: Rgb to bmp
« Reply #4 on: April 26, 2010, 02:16:46 pm »
Thanks for the link.

How can I obtain a jpeg image from TRGB32Bitmap object?
aJpgPic.Assign(RGB32Bitmap) does nt work.

 

TinyPortal © 2005-2018