473,326 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

.net 2005 printing question

i'm trying to print a bitmap.
i've put the printing code in a background worker on another thread.

this is the code i'm using.

Private Sub bw4print_DoWork(ByVal sender As System.Object, ByVal e As
System.ComponentModel.DoWorkEventArgs) Handles bw4print.DoWork
Dim MyDoc As New PrintDocument()
AddHandler MyDoc.PrintPage, AddressOf MyDoc_PrintPage
MyDoc.DefaultPageSettings.Landscape = True
MyDoc.Print()
My.Application.DoEvents()

End Sub
Private Sub MyDoc_PrintPage(ByVal sender As Object, ByVal e As
PrintPageEventArgs)

printGraph(e.Graphics, CSng((e.PageBounds.Width - 840) / 6),
CSng((e.PageBounds.Height - 519) / 3))
My.Application.DoEvents()

End Sub

Public Sub printGraph(ByVal gr As Graphics, ByVal x As Single, ByVal y
As Single)
If graph1.InvokeRequired Then
graph1.Invoke(New printGraphCallback(AddressOf printGraph), gr,
x, y)
Else
Dim g As Graphics = Graphics.FromImage(graph1.Image)
g.FillRectangle(Brushes.White, 770, 495, 70, 24)
gr.DrawImage(graph1.Image, x, y)
My.Application.DoEvents()
Dim bm As New Bitmap(My.Application.Info.DirectoryPath &
"\print.bmp")
g.DrawImage(bm, 765, 499)
My.Application.DoEvents()
End If
End Sub

i've got a 3ghz processor with 4gb of ram
the bitmap is only 25kb but the printing still ties up the system.
is there another way of doing this that leaves the system free for other
things while its printing?

Jun 18 '07 #1
0 782

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: edgrsprj | last post by:
PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT Posted July 11, 2005 My main earthquake forecasting Web page is: http://www.freewebz.com/eq-forecasting/Data.html ...
9
by: Jody Gelowitz | last post by:
I am trying to find the definition of "Safe Printing" and cannot find out exactly what this entitles. The reason is that I am trying to print contents from a single textbox to no avail using the...
7
by: Victor S. | last post by:
1. What is System.Windows.Forms.VisualStyles.TextMetricsCharacterSet good for? 2. Are the Indic scripts supported? Are all supported scripts fully supported? (for printing and fine measuring)...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
0
by: aleemkhan | last post by:
I am using SQL Server 2005 Local Reports for a web based project. The problem is that the ASP.NET default Web Report Viewer does not have print facility for Local Reports. When the report is...
1
by: steve | last post by:
Hi All Has anybody had experience with printing text and barcodes to Zebra label printers in VB.net 2005 Regards Steve
6
by: Bjorn Sagbakken | last post by:
Hi I have done some work with VS 2005 but no report-issues yet. Now I want to step up, and implement reports for printing and PDF export. I have just briefly studied the build-in report...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.