问题
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.
回答1:
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;
来源:https://stackoverflow.com/questions/15644539/how-do-i-show-the-windows-photo-printing-wizard