Brief description of devmode struct

Source: Internet
Author: User
The devmode structure has the following forms:
Typedef struct _ devicemode
{/* Dvmd */
Tchar dmdevicename [32];
Word dmspecversion;
Word dmdriverversion;
Word dmsize;
Word dmdriverextra;
DWORD dmfields;
Short dmorientation;
Short dmpapersize;
Short dmpaperlength;
Short dmpaperwidth;
Short dmscale;
Short dmcopies;
Short dmdefaultsource;
Short dmprintquality;
Short dmcolor;
Short dmduplex;
Short dmyresolution;
Short dmttoption;
Short dmcollate;
Tchar dmformname [32];
Word dmunusedpadding;
Ushort dmbitsperpel;
DWORD dmpelswidth;
DWORD dmpelsheight;
DWORD dmdisplayflags;
DWORD dmdisplayfrequency;
} Devmode;

The devmode data structure contains information about device initialization and printer environment.

Member:

Dmdevicename Specifies the name of the device supported by the driver. For example, for the PCL/HP LaserJet series, it will be a Cl/HP Laser printer. This string is different between the device drivers.
Dmspecversion Specifies the version number of the initialization data. This structure is based on the data.
Dmdriverversion Specifies the printer driver version number assigned by the printer driver developer.
Dmsize Specifies the size of the devmode structure, in bytes, excluding dmdriverdata (device-related) members. If an application only operates on a part of the data that is not related to the driver, it can use this member to determine the length of the structure, without having to have records of different versions.
Dmdriverextra Contains the number of private driver data after this structure, in bytes. If the device driver does not use the unique information of the device, set this member to zero.
Dmfields Specify which of the remaining Members with the devmode structure have been initialized. The 0th-bit (defined as DM) orientation represents dmorientation, and the 1st-bit (defined as dm_papersize) represents dmpapersize. Printer Drivers appear to only support those that are suitable for printing technology.
Dmorientation Select the direction of the paper. This member can be dmorient_portrait (1) or dmorient _ landscape (2 ).
Dmpapersize Select the size of the paper to be printed. If the length and width of the paper are both set by the dmpaperlength and dmpaperwidth members, this member can be set to 0. Otherwise, the dwpapersize member can be set to one of the following values:

Dmpaper_letter Letter, 8 1/2 × 1 inch
Mpaper_legal Legal, 8 1/2 × 14 inch
Dmpaper_a4 A4 letter, 210 × 297mm
Dmpaper_csheet C Letter, 17 × 22 inch
Dmpaper_dsheet D letter, 22 × 34 inch
Dmpaper_esheet E letter, 34 × 44 inch
Dmpaper_lettersmall Letter small, 8 1/2 × 11 inch
Dmpaper_tabloid Tabloid, 11 × 17 inch
Dmpaper_ledger Ledger, 17x0, 11 inch
Dmpaper_statement Statement, 5 1/2x8 1/2 inch
Dmpaper_executive Executive, 7 1/4x10 2 inch/
Dmpaper_a3 A3 sheet, 297 × 420mm
Dmpaper_a4small A4 small sheet, 210 × 297mm
Dmpaper_a5 A5 sheet, 148 × 210mm
Dmpaper_b4 B4 sheet, 250 × 354mm
Dmpaper_b5 B5 sheet, 182 × 257mm
Dmpaper_folio Folio, 8 1/2 × 13 inch
Dmpaper_quarto Quarto, 215 × 275mm
Dmpaper_10x14 10 × 14 inch
Dmpaper_11x17 11 × 17 inch
Dmpaper_note Note, 8 1/2 × 11 inch
Dmpaper_env_9 #9 envelope, 3 7/8x8 7/8 inch
Dmpaper_env_10 #10 envelope, 4 1/8x9 1/2 inch
Dmpaper_env_11 #11 envelope, 4 1/2x10 3/8 inch
Dmpaper_env_12 #12 envelope, 4 3/4 × 11 inch
Dmpaper_env_14 #14 envelope, 5x11 1/ 0/41
Dmpaper_env_dl DL envelope, 110 × 220mm
Dmpaper_env_c5 C5 envelope, 162 × 229mm
Dmpaper_env_c3 C3 envelope, 324 × 458mm
Dmpaper_env_c4 C4 envelope, 229 × 324mm
Dmpaper_env_c6 C6 envelope, 114 × 162mm
Dmpaper_env_c65 C65 envelope, 114 × 229mm
Dmpaper_env_b4 B4 envelope, 250 × 353mm
Dmpaper_env_b5 B5 envelope, 176 × 250mm
Dmpaper_env_b6 B6 envelope, 176 × 125mm
Dmpaper_env_italy Italy envelope, 110 × 230mm
Dmpaper_env_monarch Monarch envelope, 3 7/8x7 1/2 inch
Dmpaper_env_personal 6 3/4 envelope, 3 5/8x6 1/2 inch
Dmpaper_fanfold_us Us std Fanfold, 14 7/8 × 11 inch
Dmpaper_fanfold_std_german German STD Fanfold, 8 1/2x12 inch
Dmpaper_fanfold_lgl_german German legal Fanfold, 8 1/2x13 inch

Dmpaperlength Redefines the length of the paper specified by the dmpapersize member. It can be used to customize the size of the paper, or for dot matrix printers, which can print any length of paper. These values and other specified physical length values in this structure are in the unit of 0.1mm.
Dmpaperwidth Reload the width of the paper specified by the dmpapersize member.
Dmscale Specifies the scaling factor of the output. The actual page size is the size of the physical paper multiplied by dmscale/100. For example, if the dmscale value is 50 for the paper of the letter size, it can accommodate content equivalent to 17 × 22 inch pages, because the width and height of the output text and image are half of the original size.
Dmcopies If the device supports multi-page copying, select the number of copies to be printed.
Dmdefaultsource Reserved. It must be 0.
Dmprintquality Specifies the resolution of the printer. There are four predefined device-independent values:
Dmres_high
Dmres_medium
Dmres_low
Dmres_draft
If a positive value is given, it specifies the number of points (DPI) printed per inch, so it is related to the device.
Dmcolor For color printers, switch between color and monochrome. The following are possible values:
· Dmcolor _ color
· Dmcolor _ monochrome
Dmduplex Select the dual-sided printing mode for printers that support double-sided printing. Possible values:
· Dmdup _ Simplex
· Dmdup _ horizontal
· Dmdup _ vertical
Dmyresolution Specifies the resolution of the printer in the Y direction, in the unit of points per inch. If the printer initializes the member, the dmprintquality Member specifies the resolution of the printer in the X direction, in the unit of points per inch.
Dmttoption Specifies how to print the TrueType font. This member can take one of the following values:

· Dmtt_bitmap Print the TrueType font as a graph. This is the default action of the dot matrix printer.
· Dmtt_download Download the TrueType font as a soft font. This is the default action for HP printers using the printer control language (PCL.
· Dmtt_subdev Replace the device font with the TrueType font. This is the default action for postscript series printers.

Dmcollate Check whether multiple copies are printed. When dmcollate_false is used, the output can be faster and more effective, because no matter how many copies are printed, data is transmitted only once to the printer. Only one page is printed after the printer is notified. This member can be one of the following values:

· Dmcollate_true Proofread when multiple copies are printed.
· Dmcollate_false If multiple copies are printed, the system does not proofread them.

Dmformname The format name to be used is specified. For example, letter or legal. The complete set of these names can be obtained through the windows enumforms function.
Dmunusedpadding Used to align the structure to the DWORD boundary. This member cannot be used or referenced. Its name and usage are retained and may change in future versions.
Dmbitsperpel Specifies the color resolution of the display device, in the unit of pixel digits. For example, use 4 digits for 16 colors, 8 digits for 256 colors, and 16 digits for 65536 colors.
Dmpelswidth Specifies the width in pixels of the visible device surface. Dmpelsheight specifies the height of the visible device surface in pixels.
Dmdisplayflags Specifies the display mode of the device. The following are valid symbols:

· Dm_grayscale Specifies that the display uses a non-color device. If this flag is not set, the color mode is assumed.
· Dm_interlaced Specifies the display mode of the line. If this flag is not set, it is assumed that the non-interlaced mode is used.

Dmdisplayfrequency Specify the frequency (the number of cycles per second) used by the display device in a specific mode in Hz ).

Note:
The dmdisplaymode member is followed by private data of some device drivers. The number of private data in bytes is specified by the dmdriverextra member.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.