Click here to Skip to main content
15,887,083 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionPDF file format in vb.net Pin
Ashish Kumar Vyas17-Jul-07 0:25
Ashish Kumar Vyas17-Jul-07 0:25 
AnswerRe: PDF file format in vb.net Pin
originSH17-Jul-07 0:39
originSH17-Jul-07 0:39 
GeneralRe: PDF file format in vb.net Pin
Ashish Kumar Vyas17-Jul-07 1:05
Ashish Kumar Vyas17-Jul-07 1:05 
GeneralRe: PDF file format in vb.net Pin
Ashish Kumar Vyas17-Jul-07 1:17
Ashish Kumar Vyas17-Jul-07 1:17 
AnswerRe: PDF file format in vb.net Pin
Tom Deketelaere17-Jul-07 1:15
professionalTom Deketelaere17-Jul-07 1:15 
GeneralRe: PDF file format in vb.net Pin
Ashish Kumar Vyas17-Jul-07 1:41
Ashish Kumar Vyas17-Jul-07 1:41 
GeneralRe: PDF file format in vb.net Pin
Tom Deketelaere17-Jul-07 1:54
professionalTom Deketelaere17-Jul-07 1:54 
QuestionCheque Printing Pin
hareeshvs17-Jul-07 0:21
hareeshvs17-Jul-07 0:21 
Hi All,
I have one cheque printing module in my vb.net application. In that i am saving the x,y positions of different labels and setting label positions while previewing. Then I am printing the form as such. Since there is no form.print in vb.net, i am using the following code:

Private Print_Image As Image

'This is used to take the picture
Declare Auto Function BitBlt Lib "GDI32.DLL" ( _
ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, _
ByVal nYDest As Integer, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer, _
ByVal hdcSrc As IntPtr, _
ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As Int32) As Boolean


Private Sub mnuPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPrint.Click
'We make the form look pretty before its picture
Application.DoEvents()
Me.Refresh()
Application.DoEvents()

'Get a Graphics Object from the form
Dim FormG As Graphics = Me.CreateGraphics
FormG.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias

'Create a bitmap from that graphics
Dim i As New Bitmap(Me.Width - 6, Me.Height, FormG)

'Create a Graphics object in memory from that bitmap
Dim memG As Graphics = Graphics.FromImage(i)

'get the IntPtr's of the graphics
Dim HDC1 As IntPtr = FormG.GetHdc
Dim HDC2 As IntPtr = memG.GetHdc

'get the picture
BitBlt(HDC2, 0, 0, Me.ClientRectangle.Width, Me.ClientRectangle.Height, HDC1, 0, 0, 13369376)

''Clone the bitmap so we can dispose this one
Me.Print_Image = i.Clone()


'Clean Up
FormG.ReleaseHdc(HDC1)
memG.ReleaseHdc(HDC2)
FormG.Dispose()
memG.Dispose()
i.Dispose()

'Show the PrintDialog
PrintDialog1 = New PrintDialog
PrintDialog1.Document = PrintDocument1

Dim r As DialogResult = PrintDialog1.ShowDialog

If r = DialogResult.OK Then
'Print the document
PrintDocument1.Print()
End If
End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawImage(Me.Print_Image, 0, 0)
End Sub

All these are working fine.But now the problem is, all writings in the cheque are scattered and there is no clarity & smoothness. Anybody have any ideas to increase the clarity & smoothness? Or Is there any other ways to achive this?

Regards,
Hareesh
AnswerRe: Cheque Printing Pin
Duncan Edwards Jones17-Jul-07 0:46
professionalDuncan Edwards Jones17-Jul-07 0:46 
GeneralRe: Cheque Printing Pin
hareeshvs17-Jul-07 1:01
hareeshvs17-Jul-07 1:01 
Questionhelp with sum expression Pin
Mr.Kode17-Jul-07 0:21
Mr.Kode17-Jul-07 0:21 
AnswerRe: help with sum expression Pin
Johan Hakkesteegt17-Jul-07 1:22
Johan Hakkesteegt17-Jul-07 1:22 
GeneralRe: help with sum expression Pin
Mr.Kode17-Jul-07 1:26
Mr.Kode17-Jul-07 1:26 
QuestionList Issue Pin
Tauseef A17-Jul-07 0:01
Tauseef A17-Jul-07 0:01 
AnswerRe: List Issue [modified] Pin
Tom Deketelaere17-Jul-07 1:06
professionalTom Deketelaere17-Jul-07 1:06 
Questioncopy code source in notepad Pin
ilnaz16-Jul-07 23:31
ilnaz16-Jul-07 23:31 
AnswerRe: copy code source in notepad Pin
Vasudevan Deepak Kumar16-Jul-07 23:35
Vasudevan Deepak Kumar16-Jul-07 23:35 
AnswerRe: copy code source in notepad Pin
SHatchard16-Jul-07 23:45
SHatchard16-Jul-07 23:45 
GeneralRe: copy code source in notepad Pin
Tom Deketelaere16-Jul-07 23:59
professionalTom Deketelaere16-Jul-07 23:59 
QuestionAny one know about TreeListView Control? Pin
vurugonda16-Jul-07 23:26
vurugonda16-Jul-07 23:26 
AnswerRe: Any one know about TreeListView Control? Pin
Dave Kreskowiak17-Jul-07 3:56
mveDave Kreskowiak17-Jul-07 3:56 
GeneralRe: Any one know about TreeListView Control? Pin
vurugonda17-Jul-07 6:40
vurugonda17-Jul-07 6:40 
GeneralRe: Any one know about TreeListView Control? Pin
Dave Kreskowiak17-Jul-07 8:31
mveDave Kreskowiak17-Jul-07 8:31 
QuestionHow to create trial version for software Pin
Ajai Chaudhary16-Jul-07 22:52
Ajai Chaudhary16-Jul-07 22:52 
AnswerRe: How to create trial version for software Pin
SHatchard16-Jul-07 23:06
SHatchard16-Jul-07 23:06 

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.