PrinterCE
SDK Special Topics
.Net CF C# or VB.Net: Printing Utilities |
Option Explicit
Const vbDlgBoxUp = 0
Const vbDlgBoxDown = 1
Const vbDlgBoxDisable = 2
Const vbDlgBoxStatus = 3
Const vbDlgBoxUserCancel = 4
Const vbDlgBoxAbortError = 5
Const vbTwips = 1
Const vbPoints = 2
Const vbPixels = 3
Const vbInches = 5
Const vbMillimeters = 6
Const vbCentimeters = 7
'--------------------------------------
Dim PrinterCE1
Set PrinterCE1 = CreateObject("PrEngineCE.PrinterCE")
ImageRotate ' Call our subroutine
'--------------------------------------
private sub ImageRotate
' Demo rotations of images
PrinterCE1.SelectPrinter
Dim ContinueFlag
'Put PrinterCEs dialog box up and see if user cancelled
ContinueFlag = PrinterCE1.PrDialogBox(vbDlgBoxUp)
If (ContinueFlag <> vbDlgBoxUp) Then
if (ContinueFlag = vbDlgBoxUserCancel) then
MsgBox "User cancelled!"
else
MsgBox "Error found"
End If
PrinterCE1.KillDoc
Exit Sub
End If
PrinterCE1.ScaleMode = vbInches 'Lets do everything in inches
Dim x, y, lp, siz
x = PrinterCE1.PrPgWidth / 2
y = PrinterCE1.PrPgHeight / 2
siz = 3.5
PrinterCE1.TextX = x
PrinterCE1.JustifyHoriz = 2
PrinterCE1.DrawText "ImageRotation Demo"
PrinterCE1.JustifyHoriz = 0
For lp = 0 To 3
PrinterCE1.Rotation = lp 'Rotate North, East, South, West
PrinterCE1.DrawPicture "\Images\pumpkin.jpg", x, y, siz, siz, True
siz = siz * 0.66
Next
PrinterCE1.EndDoc
End Sub |