今天图老师小编要跟大家分享将image的图片保存为JPG格式图片方法,精心挑选的过程简单易学,喜欢的朋友一起来学习吧!
将image组件的图片保存为JPG格式图片方法procedure SaveAsJPG ;var jp: TJPEGImage; //Requires the "jpeg" unit added to "uses" clause.begin jp := TJPEGImage.Create; try with jp do begin jp.CompressionQuality := 2; jp.Compress ; Assign(Image1.Picture.Bitmap); SaveToFile('D:zhy.jpg'); end; finally jp.Free; end; ////---读入方法如下:procedure OpenJPGInImagevar jp: TJPEGImage; //Requires the "jpeg" unit added to "uses" clause.begin jp := TJPEGImage.Create; jp.LoadFromFile('D:zhy.jpg'); try with jp do begin image1.Picture.Bitmap.Assign(jp); end; finally jp.Free; end;end;