pBitmapData和pBitmapInfo怎么声明和使用?是CDIB类里面的东西吗?

lfeidoom3 2009-03-18 02:09:50
看网上一个把位图向上平移的代码、里面的pBitmapData和pBitmapInfo看不懂,是怎么声明和使用的呢?是CDIB类里面的东西吗?
for(int i=0;i <=bitmapHeight;i++)
{
for(int j=0;j <=bitmapHeight;j=j+8)
{
::StretchDIBits(pDC->GetSafeHdc(),j,bitmipHeight-i,8,i,j,bitmapHeight-1,8,i,pBitmapData,pBitmapInfo,DIB_RGB_COLORS,SRCCOPY);
}
}
...全文
120 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
闪破风浪 2009-03-18
  • 打赏
  • 举报
回复
程序怎么可以断章取义呢???
可以自己跟踪进去看看~
oyljerry 2009-03-18
  • 打赏
  • 举报
回复
看它参数说明

WINGDIAPI BOOL WINAPI StretchDIBits(
HDC hdc,
int XDest,
int YDest,
int nDestWidth,
int nDestHeight,
int XSrc,
int YSrc,
int nSrcWidth,
int nSrcHeight,
CONST VOID* lpBits,
CONST BITMAPINFO* lpBitsInfo,
UINT iUsage,
DWORD dwRop
);


Parameters

hdc
[in] Handle to the destination device context.
XDest
[in] Integer that specifies the x-coordinate, in logical units, of the upper left corner of the destination rectangle.
YDest
[in] Integer that specifies the y-coordinate, in logical units, of the upper left corner of the destination rectangle.
nDestWidth
[in] Integer that specifies the width, in logical units, of the destination rectangle.
nDestHeight
[in] Integer that specifies the height, in logical units, of the destination rectangle.
XSrc
[in] Integer that specifies the x-coordinate, in pixels, of the origin of the source rectangle in the DIB.
YSrc
[in] Integer that specifies the y-coordinate, in pixels, of the origin of the source rectangle in the DIB.
nSrcWidth
[in] Integer that specifies the width, in pixels, of the source rectangle in the DIB.
nSrcHeight
[in] Integer that specifies the height, in pixels, of the source rectangle in the DIB.
lpBits
[in] Pointer to the DIB bits, which are stored as an array of bytes.
lpBitsInfo
[in] Pointer to a BITMAPINFO structure that contains information about the DIB.
iUsage
[in] Unsigned integer that specifies whether you provided a value for the bmiColors member of the BITMAPINFO structure, and, if so, whether bmiColors contains explicit red, green, blue (RGB) values or indexes.

The following table shows the possible values.
Value Description
DIB_PAL_COLORS The array contains 16-bit indexes into the logical palette of the source device context.
DIB_RGB_COLORS The color table contains literal red, green, and blue values.
dwRop
[in] DWORD that specifies how to combine the source pixels, the current brush of the destination device context, and the destination pixels to form the new image.
fandh 2009-03-18
  • 打赏
  • 举报
回复
晕,楼主的问题问的不是很地道!
很明显,这是一个位图一些东西!
cnzdgs 2009-03-18
  • 打赏
  • 举报
回复
鼠标又击这两个变量,选择“转到定义”等。
源码下载地址: https://pan.quark.cn/s/a4b39357ea24 【运算单元构造实验报告】运算单元是计算机硬件系统中的关键构成部分,主要承担执行算术运算和逻辑运算的任务。在本次实验中,我们着重探讨了带有累加器的运算单元的设计,涵盖了溢出识别、有符号数值与无符号数值运算的差异性,以及采用补码方式进行的加法与减法运算的实现机制。 一、实验目标 1. 掌握运算单元的基本构造,理解带有累加器的运算单元的具体实现途径。 2. 学习并领会溢出检测的机制,能够设计并构建溢出检测电路,用以判定运算结果是否超出了数据型的表示范畴。 3. 明辨有符号数值和无符号数值运算的不同特性,把握它们在运算过程中各自的处理方法。 4. 熟练掌握基于补码方式的加法与减法运算的执行,理解补码形式下的溢出判定准则。 5. 熟悉运算单元内部的数据传输路线,明晰数据在运算过程中的流转路径。 6. 设计一个能够支持有符号数值与无符号数值运算、补码加法/减法运算以及有符号数值溢出检测的运算单元电路。 二、实验仪器 采用JZYL—Ⅱ型计算机组成原理实验装置,配备2片74181运算单元芯片作为算术逻辑单元(ALU),2片74LS373用作八位D型锁存器,并辅以一些基础门电路和多路选择器来完成电路设计。 三、实验内容 1. 运用片74181构建一个8位运算单元,负责处理数据的高4位与低4位。 2. 设计并实现溢出检测电路,确保在有符号数值与无符号数值的加法运算中均能准确识别溢出状况。 3. 通过74LS373增加累加器功能,使运算结果得以保存。 4. 将所有设计整合,利用多路选择器来支持有符号数值与无符号数值的加法/减法运算。 四、实验电路 1. 8位运算单元由2片74181构成,通过控制...

19,464

社区成员

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

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