How do I show the Windows photo-printing wizard?

2019-05-11 01:50发布

I found the VB function ShowPhotoPrintingWizard:

CommonDialog.ShowPhotoPrintingWizard( _
  ByVal Files As VARIANT _
) As HRESULT

How do I call that or get equivalent functionality in Delphi? I'm using Delphi 2010.

标签: delphi wia
1条回答
兄弟一词,经得起流年.
2楼-- · 2019-05-11 02:35

I think it might be this way for a single file:

uses
  ComObj;

procedure TForm1.Button1Click(Sender: TObject);
var
  CommDlg: OleVariant;
begin
  CommDlg := CreateOleObject('WIA.CommonDialog');
  CommDlg.ShowPhotoPrintingWizard('d:\Image.jpg');
end;

Or the similar for multiple files:

procedure TForm1.Button1Click(Sender: TObject);
var
  Files: OleVariant;
  CommDlg: OleVariant;
begin
  CommDlg := CreateOleObject('WIA.CommonDialog');
  Files := CreateOleObject('WIA.Vector');
  Files.Add('d:\Image 1.jpg');
  Files.Add('d:\Image 2.jpg');
  CommDlg.ShowPhotoPrintingWizard(Files);
end;
查看更多
登录 后发表回答