Salve,
Devo convertire un' immagine Bmp in jpg.
Per far ciò ho trovato un codice molto bello:
Ed ecco come si usa:codice:function BMPtoJPG (var BMPpic, JPGpic: string):boolean; var Bitmap: TBitmap; JpegImg: TJpegImage ; begin Result:=False; Bitmap := TBitmap.Create; try Bitmap.LoadFromFile(BMPpic) ; JpegImg := TJpegImage.Create; try JpegImg.Assign(Bitmap) ; JpegImg.SaveToFile(JPGpic) ; Result:=True; finally JpegImg.Free end; finally Bitmap.Free end; end;
BMPtoJPG('mybitmap.bmp','myjpeg.jpg');
Peccato che in delphi 7 (Quello che uso), la componente TJpegImage non esiste.
L'ho scaricata da qui http://www.hoerstemeier.com/jpeg.htm però non so come installarla
Qualcuno mi aiuta?