DEVMODE 结构体

typedef struct _devicemode {
  TCHAR dmDeviceName[CCHDEVICENAME]; //打印机(显示设备)名称
  WORD  dmSpecVersion;
  WORD  dmDriverVersion;  //驱动版本号
  WORD  dmSize; //结构体大小
  WORD  dmDriverExtra;
  DWORD dmFields;
  union {
    struct {
      short dmOrientation; //DMORIENT_PORTRAIT (1) 纵向 or DMORIENT_LANDSCAPE (2) 横向
      short dmPaperSize; //打印纸张类型  常用 A3:8,A4,9 ,详见下图
      short dmPaperLength; //只针对打印机, 覆盖dmPaperSize指定的纸张长度
      short dmPaperWidth; //只针对打印机,覆盖dmPaperSize指定的纸张宽度
      short dmScale; // 设置打印输出缩放因子,缩放比例为dmScale/100
      short dmCopies; //设置打印份数(如果打印机支持的话)
      short dmDefaultSource;// 指定打印机纸张来源,通过DC_BINS 标志调用DeviceCapabilities函数获取打印机可用纸张来源列表
      short dmPrintQuality; //指定打印机质量(分辨率)

/* print qualities */
#define DMRES_DRAFT (-1)
#define DMRES_LOW (-2)
#define DMRES_MEDIUM (-3)
#define DMRES_HIGH (-4)

*/

//如果指定正值,则表示设置的是DPI

    };
    struct {
      POINTL dmPosition;
      DWORD  dmDisplayOrientation;
      DWORD  dmDisplayFixedOutput;
    };
  };
  short dmColor;
  short dmDuplex;
  short dmYResolution;
  short dmTTOption;
  short dmCollate;
  TCHAR dmFormName[CCHFORMNAME];
  WORD  dmLogPixels;
  DWORD dmBitsPerPel;
  DWORD dmPelsWidth;
  DWORD dmPelsHeight;
  union {
    DWORD dmDisplayFlags;
    DWORD dmNup;
  };
  DWORD dmDisplayFrequency;
#if (WINVER >= 0x0400)
  DWORD dmICMMethod;
  DWORD dmICMIntent;
  DWORD dmMediaType;
  DWORD dmDitherType;
  DWORD dmReserved1;
  DWORD dmReserved2;
#if (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400)
  DWORD dmPanningWidth;
  DWORD dmPanningHeight;
#endif
#endif
} D

  

常用尺寸:

/* paper selections */
#define DMPAPER_FIRST DMPAPER_LETTER
#define DMPAPER_LETTER 1 /* Letter 8 1/2 x 11 in */
#define DMPAPER_LETTERSMALL 2 /* Letter Small 8 1/2 x 11 in */
#define DMPAPER_TABLOID 3 /* Tabloid 11 x 17 in */
#define DMPAPER_LEDGER 4 /* Ledger 17 x 11 in */
#define DMPAPER_LEGAL 5 /* Legal 8 1/2 x 14 in */
#define DMPAPER_STATEMENT 6 /* Statement 5 1/2 x 8 1/2 in */
#define DMPAPER_EXECUTIVE 7 /* Executive 7 1/4 x 10 1/2 in */
#define DMPAPER_A3 8 /* A3 297 x 420 mm */
#define DMPAPER_A4 9 /* A4 210 x 297 mm */
#define DMPAPER_A4SMALL 10 /* A4 Small 210 x 297 mm */
#define DMPAPER_A5 11 /* A5 148 x 210 mm */
#define DMPAPER_B4 12 /* B4 (JIS) 250 x 354 */
#define DMPAPER_B5 13 /* B5 (JIS) 182 x 257 mm */
#define DMPAPER_FOLIO 14 /* Folio 8 1/2 x 13 in */
#define DMPAPER_QUARTO 15 /* Quarto 215 x 275 mm */
#define DMPAPER_10X14 16 /* 10x14 in */
#define DMPAPER_11X17 17 /* 11x17 in */
#define DMPAPER_NOTE 18 /* Note 8 1/2 x 11 in */
#define DMPAPER_ENV_9 19 /* Envelope #9 3 7/8 x 8 7/8 */
#define DMPAPER_ENV_10 20 /* Envelope #10 4 1/8 x 9 1/2 */
#define DMPAPER_ENV_11 21 /* Envelope #11 4 1/2 x 10 3/8 */
#define DMPAPER_ENV_12 22 /* Envelope #12 4 \276 x 11 */
#define DMPAPER_ENV_14 23 /* Envelope #14 5 x 11 1/2 */
#define DMPAPER_CSHEET 24 /* C size sheet */
#define DMPAPER_DSHEET 25 /* D size sheet */
#define DMPAPER_ESHEET 26 /* E size sheet */
#define DMPAPER_ENV_DL 27 /* Envelope DL 110 x 220mm */
#define DMPAPER_ENV_C5 28 /* Envelope C5 162 x 229 mm */
#define DMPAPER_ENV_C3 29 /* Envelope C3 324 x 458 mm */
#define DMPAPER_ENV_C4 30 /* Envelope C4 229 x 324 mm */
#define DMPAPER_ENV_C6 31 /* Envelope C6 114 x 162 mm */
#define DMPAPER_ENV_C65 32 /* Envelope C65 114 x 229 mm */
#define DMPAPER_ENV_B4 33 /* Envelope B4 250 x 353 mm */
#define DMPAPER_ENV_B5 34 /* Envelope B5 176 x 250 mm */
#define DMPAPER_ENV_B6 35 /* Envelope B6 176 x 125 mm */
#define DMPAPER_ENV_ITALY 36 /* Envelope 110 x 230 mm */
#define DMPAPER_ENV_MONARCH 37 /* Envelope Monarch 3.875 x 7.5 in */
#define DMPAPER_ENV_PERSONAL 38 /* 6 3/4 Envelope 3 5/8 x 6 1/2 in */
#define DMPAPER_FANFOLD_US 39 /* US Std Fanfold 14 7/8 x 11 in */
#define DMPAPER_FANFOLD_STD_GERMAN 40 /* German Std Fanfold 8 1/2 x 12 in */
#define DMPAPER_FANFOLD_LGL_GERMAN 41 /* German Legal Fanfold 8 1/2 x 13 in */
#if(WINVER >= 0x0400)
#define DMPAPER_ISO_B4 42 /* B4 (ISO) 250 x 353 mm */
#define DMPAPER_JAPANESE_POSTCARD 43 /* Japanese Postcard 100 x 148 mm */
#define DMPAPER_9X11 44 /* 9 x 11 in */
#define DMPAPER_10X11 45 /* 10 x 11 in */
#define DMPAPER_15X11 46 /* 15 x 11 in */
#define DMPAPER_ENV_INVITE 47 /* Envelope Invite 220 x 220 mm */
#define DMPAPER_RESERVED_48 48 /* RESERVED--DO NOT USE */
#define DMPAPER_RESERVED_49 49 /* RESERVED--DO NOT USE */
#define DMPAPER_LETTER_EXTRA 50 /* Letter Extra 9 \275 x 12 in */
#define DMPAPER_LEGAL_EXTRA 51 /* Legal Extra 9 \275 x 15 in */
#define DMPAPER_TABLOID_EXTRA 52 /* Tabloid Extra 11.69 x 18 in */
#define DMPAPER_A4_EXTRA 53 /* A4 Extra 9.27 x 12.69 in */
#define DMPAPER_LETTER_TRANSVERSE 54 /* Letter Transverse 8 \275 x 11 in */
#define DMPAPER_A4_TRANSVERSE 55 /* A4 Transverse 210 x 297 mm */
#define DMPAPER_LETTER_EXTRA_TRANSVERSE 56 /* Letter Extra Transverse 9\275 x 12 in */
#define DMPAPER_A_PLUS 57 /* SuperA/SuperA/A4 227 x 356 mm */
#define DMPAPER_B_PLUS 58 /* SuperB/SuperB/A3 305 x 487 mm */
#define DMPAPER_LETTER_PLUS 59 /* Letter Plus 8.5 x 12.69 in */
#define DMPAPER_A4_PLUS 60 /* A4 Plus 210 x 330 mm */
#define DMPAPER_A5_TRANSVERSE 61 /* A5 Transverse 148 x 210 mm */
#define DMPAPER_B5_TRANSVERSE 62 /* B5 (JIS) Transverse 182 x 257 mm */
#define DMPAPER_A3_EXTRA 63 /* A3 Extra 322 x 445 mm */
#define DMPAPER_A5_EXTRA 64 /* A5 Extra 174 x 235 mm */
#define DMPAPER_B5_EXTRA 65 /* B5 (ISO) Extra 201 x 276 mm */
#define DMPAPER_A2 66 /* A2 420 x 594 mm */
#define DMPAPER_A3_TRANSVERSE 67 /* A3 Transverse 297 x 420 mm */
#define DMPAPER_A3_EXTRA_TRANSVERSE 68 /* A3 Extra Transverse 322 x 445 mm */
#endif /* WINVER >= 0x0400 */

#if(WINVER >= 0x0500)
#define DMPAPER_DBL_JAPANESE_POSTCARD 69 /* Japanese Double Postcard 200 x 148 mm */
#define DMPAPER_A6 70 /* A6 105 x 148 mm */
#define DMPAPER_JENV_KAKU2 71 /* Japanese Envelope Kaku #2 */
#define DMPAPER_JENV_KAKU3 72 /* Japanese Envelope Kaku #3 */
#define DMPAPER_JENV_CHOU3 73 /* Japanese Envelope Chou #3 */
#define DMPAPER_JENV_CHOU4 74 /* Japanese Envelope Chou #4 */
#define DMPAPER_LETTER_ROTATED 75 /* Letter Rotated 11 x 8 1/2 11 in */
#define DMPAPER_A3_ROTATED 76 /* A3 Rotated 420 x 297 mm */
#define DMPAPER_A4_ROTATED 77 /* A4 Rotated 297 x 210 mm */
#define DMPAPER_A5_ROTATED 78 /* A5 Rotated 210 x 148 mm */
#define DMPAPER_B4_JIS_ROTATED 79 /* B4 (JIS) Rotated 364 x 257 mm */
#define DMPAPER_B5_JIS_ROTATED 80 /* B5 (JIS) Rotated 257 x 182 mm */
#define DMPAPER_JAPANESE_POSTCARD_ROTATED 81 /* Japanese Postcard Rotated 148 x 100 mm */
#define DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED 82 /* Double Japanese Postcard Rotated 148 x 200 mm */
#define DMPAPER_A6_ROTATED 83 /* A6 Rotated 148 x 105 mm */
#define DMPAPER_JENV_KAKU2_ROTATED 84 /* Japanese Envelope Kaku #2 Rotated */
#define DMPAPER_JENV_KAKU3_ROTATED 85 /* Japanese Envelope Kaku #3 Rotated */
#define DMPAPER_JENV_CHOU3_ROTATED 86 /* Japanese Envelope Chou #3 Rotated */
#define DMPAPER_JENV_CHOU4_ROTATED 87 /* Japanese Envelope Chou #4 Rotated */
#define DMPAPER_B6_JIS 88 /* B6 (JIS) 128 x 182 mm */
#define DMPAPER_B6_JIS_ROTATED 89 /* B6 (JIS) Rotated 182 x 128 mm */
#define DMPAPER_12X11 90 /* 12 x 11 in */
#define DMPAPER_JENV_YOU4 91 /* Japanese Envelope You #4 */
#define DMPAPER_JENV_YOU4_ROTATED 92 /* Japanese Envelope You #4 Rotated*/
#define DMPAPER_P16K 93 /* PRC 16K 146 x 215 mm */
#define DMPAPER_P32K 94 /* PRC 32K 97 x 151 mm */
#define DMPAPER_P32KBIG 95 /* PRC 32K(Big) 97 x 151 mm */
#define DMPAPER_PENV_1 96 /* PRC Envelope #1 102 x 165 mm */
#define DMPAPER_PENV_2 97 /* PRC Envelope #2 102 x 176 mm */
#define DMPAPER_PENV_3 98 /* PRC Envelope #3 125 x 176 mm */
#define DMPAPER_PENV_4 99 /* PRC Envelope #4 110 x 208 mm */
#define DMPAPER_PENV_5 100 /* PRC Envelope #5 110 x 220 mm */
#define DMPAPER_PENV_6 101 /* PRC Envelope #6 120 x 230 mm */
#define DMPAPER_PENV_7 102 /* PRC Envelope #7 160 x 230 mm */
#define DMPAPER_PENV_8 103 /* PRC Envelope #8 120 x 309 mm */
#define DMPAPER_PENV_9 104 /* PRC Envelope #9 229 x 324 mm */
#define DMPAPER_PENV_10 105 /* PRC Envelope #10 324 x 458 mm */
#define DMPAPER_P16K_ROTATED 106 /* PRC 16K Rotated */
#define DMPAPER_P32K_ROTATED 107 /* PRC 32K Rotated */
#define DMPAPER_P32KBIG_ROTATED 108 /* PRC 32K(Big) Rotated */
#define DMPAPER_PENV_1_ROTATED 109 /* PRC Envelope #1 Rotated 165 x 102 mm */
#define DMPAPER_PENV_2_ROTATED 110 /* PRC Envelope #2 Rotated 176 x 102 mm */
#define DMPAPER_PENV_3_ROTATED 111 /* PRC Envelope #3 Rotated 176 x 125 mm */
#define DMPAPER_PENV_4_ROTATED 112 /* PRC Envelope #4 Rotated 208 x 110 mm */
#define DMPAPER_PENV_5_ROTATED 113 /* PRC Envelope #5 Rotated 220 x 110 mm */
#define DMPAPER_PENV_6_ROTATED 114 /* PRC Envelope #6 Rotated 230 x 120 mm */
#define DMPAPER_PENV_7_ROTATED 115 /* PRC Envelope #7 Rotated 230 x 160 mm */
#define DMPAPER_PENV_8_ROTATED 116 /* PRC Envelope #8 Rotated 309 x 120 mm */
#define DMPAPER_PENV_9_ROTATED 117 /* PRC Envelope #9 Rotated 324 x 229 mm */
#define DMPAPER_PENV_10_ROTATED 118 /* PRC Envelope #10 Rotated 458 x 324 mm */
#endif /* WINVER >= 0x0500 */

#if (WINVER >= 0x0500)
#define DMPAPER_LAST DMPAPER_PENV_10_ROTATED
#elif (WINVER >= 0x0400)
#define DMPAPER_LAST DMPAPER_A3_EXTRA_TRANSVERSE
#else
#define DMPAPER_LAST DMPAPER_FANFOLD_LGL_GERMAN
#endif

#define DMPAPER_USER 256

  

时间: 2024-10-25 07:24:24

DEVMODE 结构体的相关文章

关于结构体

1.结构体(struct)是由一系列具有相同类型或不同类型的数据构成的数据集合,叫做结构. typedef struct People { int a; char b; double c; }P: 其中:struct是关键词, People是标签, a b c是成员, P是此结构体声明的变量. 于是在声明变量的时候就可:P p1; 这里的P实际上就是struct People的别名.P==struct People 另外这里也可以不写People(于是也不能struct People p1;了,

Linux C中结构体初始化

    在阅读GNU/Linux内核代码时,我们会遇到一种特殊的结构初始化方式.该方式是某些C教材(如谭二版.K&R二版)中没有介绍过的.这种方式称为指定初始化(designated initializer).下面我们看一个例子,Linux-2.6.x/drivers/usb/storage/usb.c中有这样一个结构体初始化项目: static struct usb_driver usb_storage_driver = { .owner = THIS_MODULE, .name = "

在Swift结构体中如何实现写时复制?

结构体(Struct)在Swift语言中占有重要地位,在Swift标准库中,大约有90%的公开类型都是结构体,包括我们常用的Array.String.Dictionary.结构体相比类,一个最重要的特性就是它是值类型,而类似引用类型.值类型是通过复制值来赋值的,而不是引用同一个内存地址,这样就不存在数据共享的问题,能防止意外的数据改变,并且它是线程安全的. 举一个很简单的例子,在objc中,数组是类,是引用类型,在Swift中,数组是结构体,是值类型.因此下面的代码中: let array1 =

结构体的大小

系统在存储结构体变量时存在地址对齐问题,编译器在编译程序时会遵循两条原则: 一.结构体变量中成员的偏移量必须是成员大小的整数倍: 二.结构体大小必须是所有成员大小的整数倍. 1 #include<stdio.h> 2 3 struct a{ 4 int i; 5 float f; 6 char c; 7 double d; 8 long l; 9 }b; 10 11 int main(){ 12 printf("%d\n",sizeof(b.i));// 4 13 prin

关于OC中直接打印结构体,点(CGRect,CGSize,CGPoint,UIOffset)等数据类型

关于OC直接打印结构体,点(CGRect,CGSize,CGPoint,UIOffset)等数据类型,我们完全可以把其转换为OC对象来进项打印调试,而不必对结构体中的成员变量进行打印.就好比我们可以使用NSStringFromCGRect(CGRect rect)来直接打印一个结构体,其他打印可以参考以下内容 UIKIT_EXTERN NSString *NSStringFromCGPoint(CGPoint point); UIKIT_EXTERN NSString *NSStringFrom

38-oc常用结构体

常用结构体 在开发中苹果推荐我们使用CG开头的结构体, 也就是说NS开头的结构体一般不用 OC中定义一个点,用什么结构体 NSPoint; CGPoint point = NSMakePoint(10, 20); OC中保存物体尺寸的,用什么结构体 NSSize; CGSize size = NSMakeSize(100, 50); OC中保存某个物体的位置和尺寸,用什么结构体 NSRect; CGRect rect = NSMakeRect(10, 20, 100, 50); NSNumber

结构体在固件库中的应用

上次介绍了一般结构体的定义以及引用方法,那么接下来将对结构体在官方固件库是如何具体使用的做出简单说明. 结构体指针成员变量引用方法是通过“→”符号来实现,比如要访问student1结构体指针指向的结构体的成员变量name,那么方法是: stuednt1—>name; 如在STM32官方固件库中对端口使用模式结构体定义如下: typedef enum { GPIO_Mode_AIN = 0x0, //模拟输入模式 GPIO_Mode_IN_FLOATING = 0x04, //浮空输入模式 GPI

C# 定义一个学生的结构体,输入学生信息,学号,姓名,身高,按身高排序输出

class Program { //定义一个结构体 struct student//student就是我们自己造的新数据类型 { public int code;//public修饰符 public string name;//结构体的成员 public decimal height; } static void Main(string[] args) { ArrayList arr = new ArrayList(); for (int i = 0; i < 3; i++) { student

类和结构体

//类  class A {     var a = 0 } let classA = A() classA.a = 12     //虽然classA定义为常量,但是仍然可以修改A类中的变量值;结构体则不可以 //类属于引用类型,结构体属于值类型