de BMP para JPG

Delphi

25/03/2004

Olá amigos,

Tem como converter uma imagem formato bmp para jpg via programa?

Desde já agradeço.

.com


.com

.com

Curtidas 0

Respostas

Delphi32

Delphi32

25/03/2004

Faz isso:

// Declare Jpeg na seção USES. 

Function BmpToJpg(cImage: String):Boolean; 
var MyJPEG : TJPEGImage; MyBMP : TBitmap; 
begin 
   Result := False; 
   if fileExists(cImage + ´.bmp´) then
   begin 
      MyBMP := TBitmap.Create; 
      with MyBMP do
      begin
         try 
            LoadFromFile(cImage + ´.bmp´); 
            MyJPEG := TJPEGImage.Create; 
            with MyJPEG do
            begin
               Assign(MyBMP); 
               SaveToFile(cImage + ´.jpeg´); 
               Free;
               Result := True; 
            end;
         finally
            Free;
         end;
      end;
   end;
end;


bb!


GOSTEI 0
.com

.com

25/03/2004

Valeu amigo,

Tiro e queda.


GOSTEI 0
POSTAR