c of the drawing and how to do windowed mode

Users questions:Big Brother who can help solve what, how to use c + + programming window mode and drawing too!
Experts answer:C + + programming in Windows Image Programming Overview http: ** www.pconline.com.cn * pcjob * process * other * others * 0506 * 652299_1.html second method as shown below, use this method to obtain and release the device context drawing in the user area, graphics in the user area are valid: hdC = GetDc (hwnd); ... drawing operation... ReleaseDC (hwnd, hdc); use the following method to obtain and release a third device context, you can paint the entire window, graphics, valid for the entire window: hdC = GetWindowDc (hwnd); ... drawing operation ... ReleaseDc(Hwnd, hdc); use the following method to obtain and release a fourth device context, the entire display area can be drawing, graphics display area within the whole effective: hdc = CreateDC (lpszDriver, lpszDevice, lpszOutput, lpData); ... drawing operation ... ReleaseDC (hdc); which lpszDriver pointing device driver DOS file name (without extension), lpszDevice point to specific device name (for example EpsonFx-80), LpszOutput point to the physical output medium (file or output port) of the DOS file name or device name, lpData points to the device containing the device driver specific initialization data DEVMODE data structure. For example: hdc = CreateDC ("DISPLAY ", NULL, NULL, NULL); use screen drawing, and: hdc = CreateDC (" IBMGRX "," IBMGraphics "," LPT1 ", NULL); on the printer output graphics, lpData hereSet to default values, you can WIN. Locate the initialization value INI. If you do not get the device context, that context does not need to operate the equipment, only the information about device context, you can use the following statement: hdcInfo = CreateDC (lpszDriver, lpszDevice, lpszOutput, lpData); ... ... DeteteDC (hdcInfo); In addition, you can also use the device context to the memory bitmap to control, as follows: hdcMem = CreateCompatibleDC (hdc) DeleteDc (hdcMem); a meta file is a binary encoding of a collection of GDI calls, can get a metafile device context to create a file: hdcMeta = CreateMetaFile (lpszFilename); ... ... hmf = CloseMetaFile (hdCMeta); in the metafile device context is in force, carried out using hdcMeta GDI calls to any part of a per file, when you call CloseMetaFile, the device context handle change is invalid, the function returns per file (hmf) of the handle. A device context is usually related to a physical device, such as video monitors, printers, etc., so it is necessary to obtain information about the device, such as display size and color capability. By calling GetDeviceCaps function to obtain this information: nValue = GetDeviceCaps (hdc, nIndex); here hdc identification device context, nIndex determine the return value, it can be window. h defined in the identifier 28A, for example nIndex = DRIVEVERSION, then the function returns the version number. Real impact on the rendering process in the user area of the device context attributes are "mapping", and the mapping properties are closely related to the following four equipment levels defined attributes: window origin,Window origin, window area and window area. Windows defines the eight mapping. Can call the function setMapMode (hdc, MapMode) to set it in one eight mapping. hdc is used to identify the device context, nMapMode can takeMM_TEXT, MM_LOMETRIC, MM_HIMETRIC of eight in one. After setting the mapping to the mapping before the next set, Windows has been using this mapping. If you want to get the current mapping can be used: nMapMode = GetMapMode (hdc), after setting the mapping, it specifies the size of the logical units and incremental manner, in the GDI drawing functions, you can not consider the direct use of logic digital content, such as: SetMapMode (hdc, MM_TEXT); TextOut (hdc, 8,16, szBuffer, nLength) that the body region from the user eighth pixels from left to right, top edge 16 pixels from the position began to write operations. No matter how mapping, Windows function provides all the coordinates-32 768 to 32767 for the symbol with a short overall rescue. Note that mapping is just a device context attributes, the mapping is to map the only way of functioning as a device context handle attribute, while the handle as a parameter of GDI function, so as GetSystemMetrics such non-GDI functions will continue to be equipment units (pixel value) return dimension value.
  • This information provided by the users.Thanks!