HOOPS/MFC编程指南二(HOOPS/MFC Programming Guide)

1.1.1.1   打印和打印预览(Printing and Print Preview)

ChoopsView支持本机Windows的打印和打印预览,这个功能由HOOPS/MFC实现Cview::OnPrint虚函数来提供。相关的HbaseView的场景将被发送到打印机。相关信息请参见HOOPS/MVO startup segment structure

如下的ChoopsView类成员提供了底层打印逻辑控制:

m_bFastPrint:  // flag enabling print optimization; if setHOOPS will print using

             //software-frame-buffer logic

m_bMetaPrint: //flag enabling creation and playing of a metafile to the printer

如果需要在CHoopsView::OnPrint方法中执行程序特定逻辑,则需要在特定的CHoopsView类中实现该函数并调用基类(CHoopsView::OnPrint)来执行特定打印。

光栅输出选项

光栅输出一般需要很大的内存,特别是数据量比较大的光栅格式。在HOOPS中,GDIExportInfo提供了开发者控制光栅输出的方式。

GDIExportInfo::bConserveMemory

GDIExportInfo::image_dpi

如果你想修改这些值(不使用默认值),如下所示,你必须将GDIExportinfo传递到CHoopsView::OnPrint:

void MyCustomHoopsView::OnPrint( CDC*pDC, CprintInfo* pInfo )
{
GDIExportInformationoptions;
options.bConserveMemory= true;          //instruct the printer to perform banding
option.image_dpi= 300;                           //render the rasterized portion at 300 dpi to
                                   // produce a high-quality result
pInfo->m_lpUserData= &options;
 
CHoopsView::OnPrintf(pDC, pInfo );
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值