formview背景如何用意一个BMP来渲染?(平铺效果) 如提目:给出代码或者思路或连接都好啊,先多谢了啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CRect rcPicture;GetClientRect(&rcPicture);BITMAP tbm;::GetObject(hBitmap, sizeof(BITMAP), &tbm); CRect rcSrc(0, 0, tbm.bmWidth, tbm.bmHeight); CRect rcPicCell(rcPicture); rcPicCell.right = rcPicCell.left + tbm.bmWidth; rcPicCell.bottom = rcPicCell.top + tbm.bmHeight; // 从垂直方向进行平铺 for ( ;rcPicCell.top < rcPicture.bottom; rcPicCell.OffsetRect(0, tbm.bmHeight) ) { // 防止超出范围 if ( rcPicCell.bottom > rcPicture.bottom ) { rcPicCell.bottom = rcPicture.bottom; rcSrc.bottom = rcSrc.top + rcPicCell.Height(); } // 对水平方向进行平铺 for ( ;rcPicCell.right < rcPicture.right; rcPicCell.OffsetRect(tbm.bmWidth,0) ) {// draw bmp } if ( rcPicCell.left < rcPicture.right ) { // 该行还有一个 rcPicCell.right = rcPicture.right; CRect rcCell(rcSrc); rcCell.right = rcCell.left + rcPicCell.Width();// draw bmp } } BOOL CMyFormView::OnEraseBkgnd(CDC* pDC){ //用LoadImage导入位图后在dc中画出。。} http://community.csdn.net/Expert/topic/4363/4363403.xml?temp=.3139917 http://www.codeguru.com/Cpp/controls/treeview/misc-advanced/article.php/c679 请各位指教!C++ 如何获取元文件的句柄 mfc第一个程序就碰见问题,求前辈解答 为什么我的VC中关键字不显示成别的颜色????? 字符串显示的弱问 编译<<windows网络编程(第二版)>>的有的源码,有的头文件怎么找不到?? createdispatch失败的原因 如何改某个程序的图标呀,最好有代码? 一个最简单,急需要解决的问题,关于单选框的问题? 有谁知道吉林省的软件水平考试在哪报名?????高分(我要疯了)!!! 怎样判断Acrobat的打印是否取消? 请问在vc里怎么显示>256色的bitmap啊?
GetClientRect(&rcPicture);
BITMAP tbm;
::GetObject(hBitmap, sizeof(BITMAP), &tbm);
CRect rcSrc(0, 0, tbm.bmWidth, tbm.bmHeight); CRect rcPicCell(rcPicture);
rcPicCell.right = rcPicCell.left + tbm.bmWidth;
rcPicCell.bottom = rcPicCell.top + tbm.bmHeight;
// 从垂直方向进行平铺
for ( ;rcPicCell.top < rcPicture.bottom; rcPicCell.OffsetRect(0, tbm.bmHeight) )
{
// 防止超出范围
if ( rcPicCell.bottom > rcPicture.bottom )
{
rcPicCell.bottom = rcPicture.bottom;
rcSrc.bottom = rcSrc.top + rcPicCell.Height();
}
// 对水平方向进行平铺
for ( ;rcPicCell.right < rcPicture.right; rcPicCell.OffsetRect(tbm.bmWidth,0) )
{
// draw bmp
}
if ( rcPicCell.left < rcPicture.right )
{
// 该行还有一个
rcPicCell.right = rcPicture.right;
CRect rcCell(rcSrc);
rcCell.right = rcCell.left + rcPicCell.Width();
// draw bmp
}
}
{
//用LoadImage导入位图后在dc中画出。。
}