Save Image as JPG problem

Just starting out? Need help? Post your questions and find answers here.
cecilcheah
Enthusiast
Enthusiast
Posts: 168
Joined: Wed Jun 04, 2003 8:44 am
Location: Switzerland

Save Image as JPG problem

Post by cecilcheah »

Hi

I try to save image in jpg file, but i am getting nowhere

My code:

Code: Select all

If FindString(FileName$,"bmp",1) <> 0 
      Ergebnis.l = SaveImage(0, FileName$, #PB_ImagePlugin_BMP)
      MessageRequester("", Str(Ergebnis) , #MB_ICONINFORMATION) 

    Else
      
      Ergebnis.l = SaveImage(0, FileName$, #PB_ImagePlugin_JPEG)
      MessageRequester("", Str(Ergebnis), #MB_ICONINFORMATION) 

    EndIf
For BMP, it is fine, but for jpg, it is returning 0
I have already init. with

Code: Select all

UseJPEGImageDecoder()
Something wrong with my code?
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Try UseJPEGImageEncoder() :wink:

Timo
quidquid Latine dictum sit altum videtur
Post Reply