| Цитата(MSDN) | Photos are printed using the Windows XP Photo Printing Wizard... The wizard is implemented in the system file photowiz.dll but the custom interface is not exposed. Instead, the Windows Image Acquisition Library (WIA) from Microsoft is used that provides a COM wrapper for the printing wizard.
|
Библиотеку качаем http://www.microsoft.com/downloads/details.aspx?FamilyID=a332a77a-01b8-4de6-91c2-b7ea32537e29&DisplayLang=en. Установка как и для любого COM-сервера: RegSvr32 WIAAut.dll. После установки появятся новые классы, их можно использовать вот так, например:
| Код | unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ActiveX, ComObj, StdCtrls;
type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure ShowPhotoPrintWizard(Files: TStringList); var I: Integer; CommonDialog: OleVariant; { Файлы фотографий на печать } Vector: OleVariant; begin if not Assigned(Files) then Exit; CommonDialog := CreateOleObject('WIA.CommonDialog'); Vector := CreateOleObject('WIA.Vector'); for I := 0 to Files.Count - 1 do Vector.Add(Files[I]); CommonDialog.ShowPhotoPrintingWizard(Vector); Vector := Unassigned; CommonDialog := Unassigned; end;
procedure TForm1.Button1Click(Sender: TObject); var List: TStringList; begin List := TStringList.Create; with List do try Append('C:\WINDOWS\Штукатурка.bmp'); Append('C:\WINDOWS\Рододендрон.bmp'); ShowPhotoPrintWizard(List); finally Free; end; end;
end.
|
|