网站首页  词典首页

请输入您要查询的函数:

 

术语 createcompatibledc
释义 CreateCompatibleDC
语法:
HDC CreateCompatibleDC(
__in HDC hdc
);
CreateCompatibleDC函数
该CreateCompatibleDC函数创建一个内存设备上下文(DC)与指定的设备兼容。
参数
hdc [in]
句柄到现有的直流。如果该处理的是NULL,函数创建一个应用程序的当前屏幕内存DC兼容。
返回值
如果函数成功,返回值是句柄内存DC。
如果函数失败,返回值为NULL。
备注
一个内存DC只存在于内存中。当内存DC创建,它的显示表面,正是一个单色像素宽和一个单色像素高。之前,应用程序可以使用的绘制操作一个内存DC,它必须选择一个正确的宽度和高度入区位图。要选择一到区位图,使用CreateCompatibleBitmap函数,指定高度,宽度,以及组织所需要的颜色。
当一个内存DC创建,所有属性都设置为正常的默认值。直流可作为正常使用的内存区。您可以设置的属性,获取其属性的当前设置,并选择钢笔,画笔和地区。
该CreateCompatibleDC函数只能用于设备支持光栅操作。应用程序可以判断设备是否支持通过调用GetDeviceCaps函数这些行动。
当您不再需要的内存DC,调用DeleteDC函数。
如果hdc是NULL,则线程调用CreateCompatibleDC拥有创建的HDC。当此线程被破坏,为HDC不再有效。因此,如果您创建的HDC andpass到另一个线程,然后退出第一个线程,第二个线程将无法使用的HDC。
ICM的:如果DC传递给这个函数的图像颜色管理(ICM)启用,区的功能创建的ICM的功能。源和目标色彩空间中指定的区议会。
实例
有关示例,请参见捕捉图像。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
设备上下文概述
设备上下文函数
CreateCompatibleBitmap
DeleteDC
GetDeviceCaps
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==CreateCompatibleDC Function
The CreateCompatibleDC function creates a memory device context (DC) compatible with the specified device.
Syntax
HDC CreateCompatibleDC(
__in HDC hdc
);
Parameters
hdc [in]
A handle to an existing DC. If this handle is NULL, the function creates a memory DC compatible with the application's current screen.
Return Value
If the function succeeds, the return value is the handle to a memory DC.
If the function fails, the return value is NULL.
Remarks
A memory DC exists only in memory. When the memory DC is created, its display surface is exactly one monochrome pixel wide and one monochrome pixel high. Before an application can use a memory DC for drawing operations, it must select a bitmap of the correct width and height into the DC. To select a bitmap into a DC, use the CreateCompatibleBitmap function, specifying the height, width, and color organization required.
When a memory DC is created, all attributes are set to normal default values. The memory DC can be used as a normal DC. You can set the attributes; obtain the current settings of its attributes; and select pens, brushes, and regions.
The CreateCompatibleDC function can only be used with devices that support raster operations. An application can determine whether a device supports these operations by calling the GetDeviceCaps function.
When you no longer need the memory DC, call the DeleteDC function.
If hdc is NULL, the thread that calls CreateCompatibleDC owns the HDC that is created. When this thread is destroyed, the HDC is no longer valid. Thus, if you create the HDC andpass it to another thread, then exit the first thread, the second thread will not be able to use the HDC.
ICM: If the DC that is passed to this function is enabled for Image Color Management (ICM), the DC created by the function is ICM-enabled. The source and destination color spaces are specified in the DC.
Examples
For an example, see Capturing an Image .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Device Contexts Overview
Device Context Functions
CreateCompatibleBitmap
DeleteDC
GetDeviceCaps
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd183489(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:25:33