Click here to Skip to main content
15,889,281 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Calculating total value of different items Pin
Richard MacCutchan28-Sep-14 3:50
mveRichard MacCutchan28-Sep-14 3:50 
GeneralRe: Calculating total value of different items Pin
Dave Kreskowiak28-Sep-14 3:59
mveDave Kreskowiak28-Sep-14 3:59 
GeneralRe: Calculating total value of different items Pin
Tim Carmichael28-Sep-14 6:07
Tim Carmichael28-Sep-14 6:07 
GeneralRe: Calculating total value of different items Pin
Dave Kreskowiak28-Sep-14 12:43
mveDave Kreskowiak28-Sep-14 12:43 
GeneralRe: Calculating total value of different items Pin
Mycroft Holmes28-Sep-14 14:05
professionalMycroft Holmes28-Sep-14 14:05 
Questiontif img print preview Pin
drago1127-Sep-14 12:07
drago1127-Sep-14 12:07 
AnswerRe: tif img print preview Pin
Dave Kreskowiak27-Sep-14 14:41
mveDave Kreskowiak27-Sep-14 14:41 
GeneralRe: tif img print preview Pin
drago1127-Sep-14 19:41
drago1127-Sep-14 19:41 
Vb net 2010
Tif img
I would like to print that image by calling print preview
Image is larger than one print page.
I cannot get another (second) page where it should be rest of that img.
I'm using
Img.framecount(framedimension .page) where count is always 1, but should be 2.
(To divide 1 tiff img to 2 print pages)
Thanks

Imports System.Drawing.Printing
Imports System.Drawing.Imaging
Imports System.Drawing
Imports System.IO

Public Class Form2
Private fileCount As Integer = 0
Private currPage As Integer = 0
Private pCount As Integer = 0
Private currImage As Image


Private Sub vPrintDocument()
Dim vPrintDoc As New PrintDocument
vPrintDoc.DefaultPageSettings.Landscape = False

AddHandler vPrintDoc.PrintPage, AddressOf docPrintPage
AddHandler vPrintDoc.BeginPrint, AddressOf docBeginPrint


Dim i As PrintPreviewDialog = New PrintPreviewDialog
i.Document = vPrintDoc
i.ShowDialog()

End Sub


Private Sub docBeginPrint(ByVal sender As Object, ByVal e As PrintEventArgs)

currPage = 0
currImage = Image.FromFile("C:\out.tif")

pCount = currImage.GetFrameCount(Imaging.FrameDimension.Page)

‘MsgBox(pCount)
End Sub

Private Sub docPrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs)

currImage.SelectActiveFrame(Imaging.FrameDimension.Page, currPage)


e.Graphics.DrawImage(currImage, 20, 20)
currPage = currPage + 1
If currPage < pCount Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call vPrintDocument()
End Sub
End Class

modified 28-Sep-14 2:21am.

GeneralRe: tif img print preview Pin
Eddy Vluggen28-Sep-14 2:47
professionalEddy Vluggen28-Sep-14 2:47 
GeneralRe: tif img print preview Pin
Dave Kreskowiak28-Sep-14 3:36
mveDave Kreskowiak28-Sep-14 3:36 
GeneralRe: tif img print preview Pin
drago1128-Sep-14 10:14
drago1128-Sep-14 10:14 
GeneralRe: tif img print preview Pin
Eddy Vluggen29-Sep-14 5:35
professionalEddy Vluggen29-Sep-14 5:35 
GeneralRe: tif img print preview Pin
James.Cook201-Oct-14 3:54
James.Cook201-Oct-14 3:54 
QuestionCreate Image from Panel Control Pin
gwittlock27-Sep-14 9:02
gwittlock27-Sep-14 9:02 
AnswerRe: Create Image from Panel Control Pin
Eddy Vluggen27-Sep-14 13:40
professionalEddy Vluggen27-Sep-14 13:40 
GeneralRe: Create Image from Panel Control Pin
gwittlock27-Sep-14 15:23
gwittlock27-Sep-14 15:23 
GeneralRe: Create Image from Panel Control Pin
gwittlock27-Sep-14 21:27
gwittlock27-Sep-14 21:27 
GeneralRe: Create Image from Panel Control Pin
Eddy Vluggen28-Sep-14 1:53
professionalEddy Vluggen28-Sep-14 1:53 
GeneralRe: Create Image from Panel Control Pin
gwittlock28-Sep-14 4:05
gwittlock28-Sep-14 4:05 
GeneralRe: Create Image from Panel Control Pin
drago1128-Sep-14 21:13
drago1128-Sep-14 21:13 
GeneralRe: Create Image from Panel Control Pin
gwittlock29-Sep-14 3:21
gwittlock29-Sep-14 3:21 
GeneralRe: Create Image from Panel Control Pin
Eddy Vluggen29-Sep-14 5:33
professionalEddy Vluggen29-Sep-14 5:33 
GeneralRe: Create Image from Panel Control Pin
Eddy Vluggen28-Sep-14 22:12
professionalEddy Vluggen28-Sep-14 22:12 
GeneralRe: Create Image from Panel Control Pin
gwittlock29-Sep-14 3:19
gwittlock29-Sep-14 3:19 
GeneralRe: Create Image from Panel Control Pin
Eddy Vluggen29-Sep-14 5:32
professionalEddy Vluggen29-Sep-14 5:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.