Convert JPG -> BMP  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 23/12/03

Tip accessed 540 times

 


Convert JPG to BMP:

Add 'JPeg' in the uses of your form


                procedure TForm1.Button2Click(Sender: TObject);
                var
                  MyJPEG : TJPEGImage;
                  MyBMP  : TBitmap;
                begin
                  MyJPEG := TJPEGImage.Create;
                  with MyJPEG do begin
                    LoadFromFile('YourJpegHere.JPEG');
                    MyBMP := TBitmap.Create;
                    with MyBMP do begin
                      Width := MyJPEG.Width;
                      Height := MyJPEG.Height;
                      Canvas.Draw(0,0,MyJPEG);
                      SaveToFile('YourBmpHere.BMP');
                      Free;
                    end;
                    Free;
                  end;
                end;



Other method sent by: Michel Van Brackel (mvanbrackel@hotmail.com)

 procedure JPGaBMP(JpgFilePath : string; BmpSavePath : string);
 var bmp : TBitmap;
     Jpg : TJpegImage;
 begin
   bmp := TBitmap.Create;
   jpg := TJpegImage.Create;
   try
     jpg.LoadFromFile (jpgfilepath);
     bmp.Assign(jpg);
     bmp.SaveToFile (BmpSavePath + '.bmp');
   finally
     jpg.Free;
     bmp.Free;
   end;
 end;




Updated at 23/12/2003 Sent by Michel