delphi怎样打开jpeg图片代码
用picturedialog,和,buttob,image怎么做?谢谢点button1时,让image里打开一张图片...
用picturedialog,和,buttob,image怎么做?谢谢
点button1时,让image里打开一张图片 展开
点button1时,让image里打开一张图片 展开
2个回答
展开全部
设置OpenPictureDialog控件的Filter属性.
假设OpenPictureDialog控件名为OPD
OPD.Filter :=
'JPEG Image File (*.jpg)|*.jpg|JPEG Image File (*.jpeg)|*.jpeg';
假设OpenPictureDialog控件名为OPD
OPD.Filter :=
'JPEG Image File (*.jpg)|*.jpg|JPEG Image File (*.jpeg)|*.jpeg';
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把三个控件放到form中,代码很简单。最主要的是在uses调用中加入jpeg库。
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls,ExtDlgs, jpeg;
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenPictureDialog1.Execute then
image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
end;
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls,ExtDlgs, jpeg;
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenPictureDialog1.Execute then
image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
end;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询