How do I show the Windows photo-printing wizard?

瘦欲@ 提交于 2019-12-22 10:53:58

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!