📄 printer.cs
字号:
using System;
using VirtualPhotoOrganizer.Photo;
namespace VirtualPhotoOrganizer.Util
{
/// <summary>
/// handles the printing of photos
/// </summary>
internal class Printer
{
// the photos we're going to print
Photos _Photos;
public Printer(Photos photos) {
_Photos = photos;
}
public Photos Photos {
get { return _Photos; }
set { _Photos = value; }
}
/// <summary>
/// prints the list of photos
/// </summary>
public void Print() {
// create the vector COM object
WiaInterop.VectorClass vector = new WiaInterop.VectorClass();
// add the paths or our photos to the vector object
foreach (Photo.Photo p in _Photos) {
object path = (object) p.Path;
vector.Add(ref path, 0);
}
// create and show the printing wizard dialog
WiaInterop.CommonDialogClass dlg = new WiaInterop.CommonDialogClass();
object vec = (object) vector;
dlg.ShowPhotoPrintingWizard(ref vec);
// mark the com objects for deletion from heap
dlg = null;
vector = null;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -