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);
}
}
...全文
121 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
  • 打赏
  • 举报
回复
鼠标又击这两个变量,选择“转到定义”等。
内容概要:本文研究基于豪猪算法(CPO)实现多无人机协同集群在三维空间中的避障路径规划,旨在通过优化目标函数(最低成本,涵盖路径长度、飞行高度、威胁规避和转弯角度)来提升无人机集群的任务执行效率与安全性。该方法采用Matlab进行算法设计与仿真验证,系统性地展示了CPO算法在复杂三维动态环境下的路径搜索能力与优化性能,突出其在多机协同、动态障碍物规避和资源最优分配方面的优势。研究不仅实现了路径规划的核心算法构建,还提供了完整的代码资源与仿真案例,便于进一步对比分析与工程应用。; 适合人群:具备一定Matlab编程基础,从事无人机控制、智能优化算法、路径规划、协同导航、自动化系统等相关领域的科研人员、研究生及工程技术人员。; 使用场景及目标:①开展多无人机协同作业中的三维路径规划研究;②评估并对比豪猪算法(CPO)与其他智能优化算法(如GA、PSO、GWO、TTHHO等)在路径规划任务中的性能差异;③实现复杂环境中多无人机的安全避障、能耗优化与飞行稳定性提升的仿真与验证。; 阅读建议:建议结合提供的Matlab代码进行仿真实践,重点关注目标函数的建模方式、CPO算法的迭代机制与参数敏感性分析,并通过与其它算法的对比实验深入理解其收敛性、鲁棒性及适用范围。
内容概要:本文档围绕“无电流传感器模型预测MPC串联型谐振DAB模型”的Simulink仿真实现展开,系统介绍了基于模型预测控制(MPC)的高性能控制策略在串联型谐振双有源桥(DAB)变换器中的应用,重点突出无需传统电流传感器的设计思路,以降低硬件成本并提升系统可靠性。文档整合了大量电力电子与控制领域的高价值仿真资源,涵盖LLC谐振变换器、微电网调度、状态估计、故障检测、优化算法等多个方向,并提供配套的Matlab/Simulink代码与模型,部分标注为“创新未发表”或“博士/硕士论文复现”,具有较强的科研前瞻性与复现参考价值。所有资料可通过百度网盘及公众号“荔枝科研社”获取。; 适合人群:电力电子、自动化、电气工程及其相关专业的研究生、高校科研人员,以及从事新能源发电、储能系统、电力变换器开发的工程技术人员。; 使用场景及目标:① 深入理解无电流传感器控制与MPC在DAB变换器中的融合机制与实现方法;② 利用所提供的Simulink模型与Matlab代码进行科研复现、算法改进与系统性能优化;③ 拓展应用于谐振变换器、微电网能量管理、电力电子系统稳定性分析等相关课题的研究与工程实践。; 阅读建议:建议结合仿真模型动手实践,优先从基础案例入手,循序渐进地过渡到复杂系统;重点关注标注“复现”与“创新”的内容以激发科研灵感,同时注意梳理各技术模块间的内在联系,构建系统化的知识架构。

19,464

社区成员

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

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