有谁知道关于CBitmap::SetBitmapBits()函数的具体用法,最好有源码!

smq 2002-10-22 11:36:21
怎样设置一个Bitmap的Bits,我知道要在某个位图上画很多填充的多边形,直接用PolyLine()太慢,不能符合要求,不知能不能计算出位图中各个位,然后用SetBitmapBits函数直接赋值,我想这样可能会快一些,请各位大虾指教!!!
...全文
189 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qing_li73 2002-10-22
  • 打赏
  • 举报
回复
see the sample below, just what u want :

http://www.codeproject.com/useritems/using_get_set_bitmapbits.asp
qing_li73 2002-10-22
  • 打赏
  • 举报
回复
SetBitmapBits
The SetBitmapBits function sets the bits of color data for a bitmap to the specified values.

Note The SetBitmapBits function is included only for compatibility with 16-bit versions of Windows. For Win32-based applications, use the SetDIBits function.

LONG SetBitmapBits(
HBITMAP hbmp, // handle to bitmap
DWORD cBytes, // number of bytes in bitmap array
CONST VOID *lpBits // address of array with bitmap bits
);

Parameters
hbmp
Handle to the bitmap to be set.
cBytes
Specifies the number of bytes pointed to by the lpBits parameter.
lpBits
Pointer to an array of bytes that contain color data for the specified bitmap.
Return Values
If the function succeeds, the return value is the number of bytes used in setting the bitmap bits.

If the function fails, the return value is zero.

Windows NT: To get extended error information, callGetLastError.

Remarks
The array identified by lpBits must be WORD aligned.

See Also
Bitmaps Overview, Bitmap Functions, GetBitmapBits, SetDIBits


19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧