Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JPEG Pictures

Status
Not open for further replies.

tjcusick

Programmer
Dec 26, 2006
134
US
Does anyone know if there is a way in Delphi Code to convert a non JPEG picture to a '.jpg'?

Thanks for the help

Tom C
 
Code:
uses
  Jpeg, ClipBrd;


procedure TfrmMain.ConvertBMP2JPEG;
var
  jpgImg: TJPEGImage;
begin
  chrtOutputSingle.CopyToClipboardBitmap;
  Image1.Picture.Bitmap.LoadFromClipboardFormat(cf_BitMap,
    ClipBoard.GetAsHandle(cf_Bitmap), 0);
  jpgImg := TJPEGImage.Create;
  jpgImg.Assign(Image1.Picture.Bitmap);
  jpgImg.SaveToFile('TChartExample.jpg');
end;

source taken from delphitricks.com

Hope this helps :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top