Board index » cppbuilder » BMP->JPEG

BMP->JPEG

Recently I installed jpegpkg.lib library and now I can manipulate jpeg
files, but I have a problem. I read bitmap from TWAIN compatible device and
I'd like to store the file as JPEG file. Simple method:
   Image1->Picture->Graphic->SaveToFile("file.jpg");
 doesn't get the solution because there is no compression performed (file
has the same size as bitmap file). Are there any routines to compress
bitmap to jpeg.
How can I do that? Thanks in advance.
 

Re:BMP->JPEG


Can you Assign the Bitmap->Image->Picture to a TJpegimage and save
that?

On 23 Feb 1999 23:53:38 GMT, "Arkadiusz Kubach" <ar...@ds2.pg.gda.pl>
wrote:

Quote
>Recently I installed jpegpkg.lib library and now I can manipulate jpeg
>files, but I have a problem. I read bitmap from TWAIN compatible device and
>I'd like to store the file as JPEG file. Simple method:
>   Image1->Picture->Graphic->SaveToFile("file.jpg");
> doesn't get the solution because there is no compression performed (file
>has the same size as bitmap file). Are there any routines to compress
>bitmap to jpeg.
>How can I do that? Thanks in advance.

Ken Moffat
kmof...@halcyon.com

Re:BMP->JPEG


Ken Moffat <kmof...@halcyon.com> napisa3(a) w artykule
<36d349f7.58298...@forums.borland.com>...
 Can you Assign the Bitmap->Image->Picture to a TJpegimage and save
 that?

 Can you explaine me that more clear?
 There was exception when I was doing following:

  TJPEGImage *jpegimage;
  jpegimage->Assign(Image1->Picture);    <---- EAccessViolation Exception
  jpegimage->SaveToFile("File.jpg");
 I'm begin working with C++ Builder and I probably doing stupid mistakes.
 What am I doing wrong?

Re:BMP->JPEG


Try something like this.
Image1 holds a bmp.

               TJPEGImage* J = new TJPEGImage;
                J->Assign(Image1->Picture->Graphic);
                J->SaveToFile(filename);

On 24 Feb 1999 01:26:14 GMT, "Arkadiusz Kubach" <ar...@ds2.pg.gda.pl>
wrote:

Quote

>Ken Moffat <kmof...@halcyon.com> napisa3(a) w artykule
><36d349f7.58298...@forums.borland.com>...
> Can you Assign the Bitmap->Image->Picture to a TJpegimage and save
> that?

> Can you explaine me that more clear?
> There was exception when I was doing following:

>  TJPEGImage *jpegimage;
>  jpegimage->Assign(Image1->Picture);    <---- EAccessViolation Exception
>  jpegimage->SaveToFile("File.jpg");

> I'm begin working with C++ Builder and I probably doing stupid mistakes.
> What am I doing wrong?

Ken Moffat
kmof...@halcyon.com

Re:BMP->JPEG


In article <01be5f87$c63f1840$a2aa1...@arkus.ds2.pg.gda.pl>, "Arkadiusz Kubach" <ar...@ds2.pg.gda.pl> wrote:

Quote
>Recently I installed jpegpkg.lib library and now I can manipulate jpeg
>files, but I have a problem. I read bitmap from TWAIN compatible device and
>I'd like to store the file as JPEG file. Simple method:
>   Image1->Picture->Graphic->SaveToFile("file.jpg");
> doesn't get the solution because there is no compression performed (file
>has the same size as bitmap file). Are there any routines to compress
>bitmap to jpeg.
>How can I do that? Thanks in advance.

There is C++ source code on www.colosseumbuilders.com to do just that.

John - N8086N
Wise man says "Never use a bank with the initials F. U."
----------------------------------------- Matloff --
Are you interested in a professional society or
guild for programmers?

See www.programmersguild.org/american.htm
Newsgroup: us.issues.occupations.computer-programmers

EMail Address:
_m-i-a-n-o_@_c_o_l_o_s_s_e_u_m_b_u_i_l_d_e_r_s._c_o_m_

Re:BMP->JPEG


Yep that code works.... I've been doing some cool stuff with it :)

Other Threads