寻找yushulei(永远)

syoyc 2003-11-06 05:16:10
yushulei(永远) ( ) 信誉:100 2003-11-06 13:06:00 得分:0


在OnPreparePrinting中:如果是饼图打印
pChartLine->EditCopy();

if(IsClipboardFormatAvailable(CF_BITMAP))
{
if(OpenClipboard())
{
m_hbitmap = (HBITMAP)::GetClipboardData(CF_BITMAP); CloseClipboard();
}
}

pChartLine是什么?





...全文
30 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yushulei 2003-11-14
  • 打赏
  • 举报
回复
那应该是你得onprint函数写得有问题,你看看我写得:m_hbitmap再以前给你得帖子里有过。
if(m_hbitmap)
{
BITMAP bm;
::GetObject(m_hbitmap, sizeof(BITMAP), &bm);
CSize chartSize(bm.bmWidth, bm.bmHeight);

CDC dcMemory,dcScreen;
dcScreen.Attach(::GetDC(NULL));

// create "from" device context and select the loaded bitmap into it
dcMemory.CreateCompatibleDC(&dcScreen);
dcMemory.SelectObject(m_hbitmap);

// Print at 85% size within left/right margin
CSize printSize;
printSize.cx=(int)(rectPage.right*.85);
printSize.cy=printSize.cx/chartSize.cx*chartSize.cy;
CRect rect(0,0,printSize.cx,printSize.cy);

// Print chart centered
pDC->StretchBlt( ((rectPage.right+rectPage.left)/2)-(printSize.cx/2), rectPage.top, printSize.cx, printSize.cy, &dcMemory, 0, 0, chartSize.cx, chartSize.cy, SRCCOPY);
dcMemory.DeleteDC();
}
syoyc 2003-11-13
  • 打赏
  • 举报
回复
我要打印一个饼图,放在剪贴板里,打印预览已经看到了该饼图,但是为啥不能打印出该饼图?
饼图颜色是彩色,打印机是单色
neuboy 2003-11-07
  • 打赏
  • 举报
回复
look too!!
xiaohedou 2003-11-07
  • 打赏
  • 举报
回复
look!
yushulei 2003-11-07
  • 打赏
  • 举报
回复
是msChart控件的句饼

15,979

社区成员

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

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