Board index » cppbuilder » Problems using GraphicEx with JPEGs

Problems using GraphicEx with JPEGs

Hi all,
i thought i solved all my GraphicEx with BCB6, but i got a new problem i
would like to share.
If i load BMP or GIF or TIFF or PSD the Image->Picture->Bitmap is a valid
bitmap, but if i load JPG the Image->Picture->Bitmap is and empty bitmap,
but i can see it on my form.
I think i'm doing something wrong, anyway i paste the little code.
 

Re:Problems using GraphicEx with JPEGs


Hi all,
i thought i solved all my GraphicEx with BCB6, but i got a new problem i
would like to share.
If i load BMP or GIF or TIFF or PSD the Image->Picture->Bitmap is a valid
bitmap, but if i load JPG the Image->Picture->Bitmap is and empty bitmap,
but i can see it on my form.
I think i'm doing something wrong, anyway i paste the little code.

...
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Image1->Picture->LoadFromFile("C:\\testimage.jpeg");

Quote
}

//--------------------------------------------------------------------------
-
void __fastcall TForm1::Button2Click(TObject *Sender)
{
  Image2->Picture->Bitmap=Image1->Picture->Bitmap;
Quote
}

//--------------------------------------------------------------------------
-
...

Well i have i form with two images and two buttons, the first load the image
and the second "should" copy the Image1 to the Image2.
As i said before, it works if image loaded is not a JPG.

Any tips?

Thanks again for the help.

Lapo from Italy

P.S. I'm sorry for the previous post, i pushed the wrong button.

Re:Problems using GraphicEx with JPEGs


Put the line
#include <jpeg.hpp>
near the top of the file Unit1.h.

Other Threads