网站首页  词典首页

请输入您要查询的函数:

 

术语 createbitmapindirect
释义 CreateBitmapIndirect
语法:
HBITMAP CreateBitmapIndirect(
__in const BITMAP *lpbm
);
CreateBitmapIndirect功能
该CreateBitmapIndirect函数创建一个具有指定宽度,高度位图和颜色格式(彩色飞机位每像素)。
参数
lpbm [in]
阿位图结构,其中包含关于位图信息的指针。如果应用程序设置bmWidth或bmHeight成员为零,CreateBitmapIndirect返回句柄1 × 1像素,单色位图。
返回值
如果函数成功,返回值是一个位图句柄。
如果函数失败,返回值为NULL。
这个函数可以返回以下值。
返回codeDescription
ERROR_INVALID_PARAMETEROne或输入参数更是无效的。
ERROR_NOT_ENOUGH_MEMORYThe位图太大的内存分配。
备注
该CreateBitmapIndirect函数创建一个依赖于设备的位图。
之后创建一个位图,它可以成为一个设备上下文选择通过调用SelectObject函数。然而,位图,只能选择到设备上下文,如果位图和区具有相同的格式。
虽然CreateBitmapIndirect函数可用于创建彩色位图,出于性能方面的应用程序应该使用CreateBitmapIndirect创建单色位图和CreateCompatibleBitmap创建位图的颜色。每当从CreateBitmapIndirect色位图是到设备上下文选择,系统必须确保位图相匹配的设备上下文它被选定为格式。由于CreateCompatibleBitmap需要一个设备上下文,它返回一个位图,它具有与指定的设备上下文相同的格式。因此,后续调用SelectObject更快了由CreateCompatibleBitmap色位图比位图的颜色从CreateBitmapIndirect返回。
如果位图是单色的,零代表前景色的代表和为目标设备上下文的背景颜色。
当您不再需要的位图,调用DeleteObject函数将其删除。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
位图概述
位图功能
BitBLT等
位图
CreateBitmap
CreateCompatibleBitmap
CreateDIBitmap
DeleteObject
SelectObject
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==CreateBitmapIndirect Function
The CreateBitmapIndirect function creates a bitmap with the specified width, height, and color format (color planes and bits-per-pixel).
Syntax
HBITMAP CreateBitmapIndirect(
__in const BITMAP *lpbm
);
Parameters
lpbm [in]
A pointer to a BITMAP structure that contains information about the bitmap. If an application sets the bmWidth or bmHeight members to zero, CreateBitmapIndirect returns the handle to a 1-by-1 pixel, monochrome bitmap.
Return Value
If the function succeeds, the return value is a handle to the bitmap.
If the function fails, the return value is NULL.
This function can return the following values.
Return codeDescription
ERROR_INVALID_PARAMETEROne or more of the input parameters is invalid.
ERROR_NOT_ENOUGH_MEMORYThe bitmap is too big for memory to be allocated.

Remarks
The CreateBitmapIndirect function creates a device-dependent bitmap.
After a bitmap is created, it can be selected into a device context by calling the SelectObject function. However, the bitmap can only be selected into a device context if the bitmap and the DC have the same format.
While the CreateBitmapIndirect function can be used to create color bitmaps, for performance reasons applications should use CreateBitmapIndirect to create monochrome bitmaps and CreateCompatibleBitmap to create color bitmaps. Whenever a color bitmap from CreateBitmapIndirect is selected into a device context, the system must ensure that the bitmap matches the format of the device context it is being selected into. Because CreateCompatibleBitmap takes a device context, it returns a bitmap that has the same format as the specified device context. Thus, subsequent calls to SelectObject are faster with a color bitmap from CreateCompatibleBitmap than with a color bitmap returned from CreateBitmapIndirect.
If the bitmap is monochrome, zeros represent the foreground color and ones represent the background color for the destination device context.
When you no longer need the bitmap, call the DeleteObject function to delete it.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Bitmaps Overview
Bitmap Functions
BitBlt
BITMAP
CreateBitmap
CreateCompatibleBitmap
CreateDIBitmap
DeleteObject
SelectObject
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd183486(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:15:54