Hello smart9dotcom,

taken from http://www.greatis.com/delphi/tips.html


{ Button1Click procedure creates variable of TJPEGImage type and loads
there  a  picture.
Button2Click procedure creates variable of TBitmap
type and draws there jpeg. }

uses JPEG;
...
var
 JPEGImage: TJPEGImage;
...
procedure TForm1.Button1Click(Sender: TObject);
begin
  JPEGImage:=TJPEGImage.Create;
  if OpenDialog1.Execute then
  begin
    JPEGImage.LoadFromFile(OpenDialog1.FileName);
    Image1.Canvas.Draw(0,0,JPEGImage);
  end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  Bitmap: TBitmap;
begin
  try
    Bitmap:=TBitmap.Create;
    Bitmap.PixelFormat:=pf24bit;
    Bitmap.Height:=JPEGImage.Height;
    Bitmap.Width:=JPEGImage.Width;
    Bitmap.Canvas.Draw(0,0, JPEGImage);
    if SaveDialog1.Execute then
      Bitmap.SaveToFile(SaveDialog1.FileName);
    Label1.Caption:='Convertation finised';
  finally
    Bitmap.Free;
    JPEGImage.Free;
  end;
end;

*************************************************

Hari Minggu, 5/15/2005, 4:32:32 PM, smart9dotcom nulis:

s> i want to ask how i can change .jpg image to .bmp image in Delphi ?


-- 
Best regards,
Irwan
A rose by any other name would be "deadly thorn-bearing assault vegetation."



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to