Delphi中调用Windows自带的图片和传真浏览器查看图片,可以旋转图片也可以调用画图程序编辑图像。自己写不出来好的代码,就用系统自带的好了。
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,ShellAPI;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
Var
SysDir,StrParm,StrPicPath,StrRundll:array[0..128] of char;
p1,p2:pchar;
begin
GetSystemDirectory(SysDir,128);
StrRundll:=SysDir;
strcat(StrRundll,'/rundll32.exe');
// showmessage('获取rundll32路径正常');
StrParm:=SysDir;
Strcat(StrParm,'/shimgvw.dll imageview_fullscreen ');
StrPicPath:='D:/My Document/My Pictures/未命名.bmp';
strcat(StrParm,StrPicPath);
// showmessage('获取strparm正常');
ShellExecute(Form1.Handle,nil,pChar(@StrRundll),pChar(@StrParm),nil,SW_SHOWMAXIMIZED);
edit1.Text:=strparm;
end;
end.