PrinterSettings.PrinterResolutionCollection 类
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
包含 PrinterResolution 对象的集合。
public: ref class PrinterSettings::PrinterResolutionCollection : System::Collections::ICollection
public class PrinterSettings.PrinterResolutionCollection : System.Collections.ICollection
type PrinterSettings.PrinterResolutionCollection = class
interface ICollection
interface IEnumerable
Public Class PrinterSettings.PrinterResolutionCollection
Implements ICollection
- 继承
-
PrinterSettings.PrinterResolutionCollection
- 实现
下面的代码示例使用 comboPrintResolution
支持的分辨率填充组合框。 该示例要求 PrintDocument 存在名为 的 printDoc
变量,并且存在特定的组合框。
// Add list of printer resolutions found on the printer to the combobox.
// The PrinterResolution's ToString() method will be used to provide the display String.
PrinterResolution^ pkResolution;
for ( int i = 0; i < printDoc->PrinterSettings->PrinterResolutions->Count; i++ )
{
pkResolution = printDoc->PrinterSettings->PrinterResolutions[ i ];
comboPrintResolution->Items->Add( pkResolution );
}
// Add list of printer resolutions found on the printer to the combobox.
// The PrinterResolution's ToString() method will be used to provide the display string.
PrinterResolution pkResolution;
for (int i = 0; i < printDoc.PrinterSettings.PrinterResolutions.Count; i++){
pkResolution = printDoc.PrinterSettings.PrinterResolutions[i];
comboPrintResolution.Items.Add(pkResolution);
}
' Add list of printer resolutions found on the printer to the combobox.
' The PrinterResolution's ToString() method will be used to provide the display string.
Dim pkResolution As PrinterResolution
For i = 0 to printDoc.PrinterSettings.PrinterResolutions.Count - 1
pkResolution = printDoc.PrinterSettings.PrinterResolutions.Item(i)
comboPrintResolution.Items.Add(pkResolution)
Next
PrinterSettings.PrinterResolutionCollection包含PrinterResolution表示通过 PrinterResolution.Kind 属性支持的打印机分辨率的 实例,该属性包含值之PrinterResolutionKind一。
通常,通过 PageSettings.PrinterResolution 属性将打印机的分辨率设置为通过 PrinterResolutions 集合提供的有效PrinterResolution实例。
如果 PrinterResolutionKind 为 Custom
,则使用 X 和 Y 属性分别确定水平方向和垂直方向的自定义打印机分辨率。
Printer |
初始化 PrinterSettings.PrinterResolutionCollection 类的新实例。 |
Count |
获取集合中可用打印机分辨率的数目。 |
Item[Int32] |
获取指定索引处的 PrinterResolution。 |
Add(Printer |
将 PrinterResolution 添加到集合的末尾。 |
Copy |
将当前 PrinterSettings.PrinterResolutionCollection 的内容复制到指定数组,从指定索引处开始。 |
Equals(Object) |
确定指定对象是否等于当前对象。 (继承自 Object) |
Get |
返回一个可循环访问集合的枚举数。 |
Get |
作为默认哈希函数。 (继承自 Object) |
Get |
获取当前实例的 Type。 (继承自 Object) |
Memberwise |
创建当前 Object 的浅表副本。 (继承自 Object) |
To |
返回表示当前对象的字符串。 (继承自 Object) |
ICollection. |
有关此成员的说明,请参见 CopyTo(Array, Int32)。 |
ICollection. |
有关此成员的说明,请参见 Count。 |
ICollection. |
有关此成员的说明,请参见 IsSynchronized。 |
ICollection. |
有关此成员的说明,请参见 SyncRoot。 |
IEnumerable. |
有关此成员的说明,请参见 GetEnumerator()。 |
Cast<TResult>(IEnumerable) |
将 IEnumerable 的元素强制转换为指定的类型。 |
Of |
根据指定类型筛选 IEnumerable 的元素。 |
As |
启用查询的并行化。 |
As |
将 IEnumerable 转换为 IQueryable。 |
产品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |