Drawing Graphics using the iprintview interface of Xtreme command bars ActiveX control in VB _ postscript

Source: Internet
Author: User

 

Part 1ArticleI wrote in VB and used the iprintview interface of the Xtreme command bars ActiveX Control to draw a graph. However, I found a fatal problem. There was no problem during previewing, But when I output the image to the printer, it was a piece

Black, so the previous articleCodeInvalid. The code is re-updated to solve the above problem

The principle of this implementation is to re-paint the pixels one by one.

First, use the iprintview interface class,

Implements iprintviewprivate type rect left as long top as long right as long bottom as longend typeprivate sub iprintview_beginprinting (byval HDC as long, byval hattribdc as long, byval printinfo as xtremecommandbars. printinfo) end subprivate sub iprintview_endprinting (byval HDC as long, byval hattribdc as long, byval printinfo as xtremecommandbars. printinfo) end subprivate sub iprintview_preparedc (byval HDC as long, byval hattribdc as long, byval printinfo as xtremecommandbars. printinfo) end subprivate sub iprintview_prepareprinting (byval printinfo as xtremecommandbars. printinfo) printinfo. maxpage = 1 end subprivate sub iprintview_printpage (byval HDC as long, byval hattribdc as long, byval printinfo as xtremecommandbars. printinfo) dim R as rect R. left = printinfo. printrectleft R. top = printinfo. printrecttop R. right = printinfo. printrectright R. bottom = printinfo. printrectbottomif not printinfo. previewmode thenzoomimage 4500,450 0end ifmemoutput HDC, falseend sub

Then the call class

 
WithPic1
. Autoredraw =True
. Appearance =0
. Borderstyle =0
. Scalemode =3
End With
W = pic1.scalewidth
H = pic1.scaleheight
Memget pic1.hdc,0,0, W-1, H-1

SetForm7.printpreview. printview = CLS
Form7.show vbmodal

Then download the relevant function module.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.