可以进行位图的预览,但是不能对位图进行打印输出,非Doc/View类的对话框打印中如何进行换页处理 你好,能不能把你那个对话框中的打印代码给我看看,我只要求能打印出字符即可,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 打印用CBitmap较方便CBitmap* m_pBmp;HDC hdc = CreateCompatibleDC(hPDC);SelectObject(hdc,*m_pBmp);if(StartDoc(hPDC,&di) > 0) {StretchBlt(hPDC,x,y,5*m_pBmp->Width(),5*m_pBmp->Height(),hdc,0,0,m_pBmp->Width(),m_pBmp->Height(),SRCCOPY); } else MessageBox("执行打印作业时产生错误,可能是打印机没准备好。","错误",MB_OK|MB_ICONWARNING); EndDoc(hPDC);换页:CPrintInfo Info;Info.m_rectDraw.SetRect(0,0, dc.GetDeviceCaps(HORZRES), dc.GetDeviceCaps(VERTRES)); OnBeginPrinting(&dc, &Info); for (UINT page = Info.GetMinPage(); page <= Info.GetMaxPage() && bPrintingOK; page++) { dc.StartPage(); // begin new page Info.m_nCurPage = page; OnPrint(&dc, &Info); // Call your "Print page" function bPrintingOK = (dc.EndPage() > 0); // end page } MFC图片 限制鼠标范围 MFC 列表框中怎么没有CListCtrl 求救:vc 实现gps 定位的数据处理 请问vs2005下做的C++东西.是不是和c#一样.需要.net框架的支持 在VC中设计界面的时候怎么让一个控件在其他控件的上层 ftp文件传输问题 ijl1.5将内存中的位图专成jpeg文件出现不正常现象 欢迎来我的网站看看 请教高手:关于保存窗口问题? 请问: CListCtrl::DrawItem 是在哪一个类成员函数中被调用的? 也就是说,她是在响应什么消息时被调用的? combo listbox怎么用?
CBitmap* m_pBmp;
HDC hdc = CreateCompatibleDC(hPDC);
SelectObject(hdc,*m_pBmp);
if(StartDoc(hPDC,&di) > 0)
{
StretchBlt(hPDC,x,y,5*m_pBmp->Width(),5*m_pBmp->Height(),hdc,0,0,m_pBmp->Width(),m_pBmp->Height(),SRCCOPY);
}
else
MessageBox("执行打印作业时产生错误,可能是打印机没准备好。","错误",MB_OK|MB_ICONWARNING);
EndDoc(hPDC);
换页:
CPrintInfo Info;
Info.m_rectDraw.SetRect(0,0,
dc.GetDeviceCaps(HORZRES),
dc.GetDeviceCaps(VERTRES)); OnBeginPrinting(&dc, &Info);
for (UINT page = Info.GetMinPage();
page <= Info.GetMaxPage() && bPrintingOK;
page++)
{
dc.StartPage(); // begin new page
Info.m_nCurPage = page;
OnPrint(&dc, &Info); // Call your "Print page" function
bPrintingOK = (dc.EndPage() > 0); // end page
}