Converter imagem de bmp para jpg

Delphi

09/09/2005

Galera.. estou salvando uma imagem no meu C:\
com o nome de test.bmp..
estou fazendo a conversão dele para jpg..
como posso fazer pra pegar o nome da imagem e depois salva-la com o mesmo nome só que .jpg

meu codigo abaixo


procedure TForm1.Button1Click(Sender: TObject);
var MyJPEG : TJPEGImage;
MyBMP : TBitmap;
cimage :string;
begin
cimage := ´\test.bmp´;
MyBMP := TBitmap.Create;
MyBMP.LoadFromFile(cImage);
MyJPEG := TJPEGImage.Create;
MyJPEG.Assign(MyBMP);
MyJPEG.SaveToFile(cImage + ´.jpg´);
MyJPEG.Free;
end;


Eric.miranda

Eric.miranda

Curtidas 0

Respostas

Rjun

Rjun

09/09/2005

Acho que esse tópico tem o que você esta procurado

http://forum.clubedelphi.net/viewtopic.php?t=55549


GOSTEI 0
Eric.miranda

Eric.miranda

09/09/2005

pô moçada.. depois que postei a msg.. vi o meu vacilo.. tá na cara..
desculpa a pergunta besta..

procedure TForm1.Button1Click(Sender: TObject);
var MyJPEG : TJPEGImage;
MyBMP : TBitmap;
cimage :string;
begin
cimage := ´\test.bmp´;
MyBMP := TBitmap.Create;
MyBMP.LoadFromFile(cImage);
MyJPEG := TJPEGImage.Create;
MyJPEG.Assign(MyBMP);
MyJPEG.SaveToFile(´\test.jpg´);
MyJPEG.Free;
end;

obrigado
Eric


GOSTEI 0
POSTAR