473,396 Members | 1,987 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,396 software developers and data experts.

Printing a Graphics Object

I have a Graphics object in a control that has an image I want to
print...I want to print my already made Graphics object that I use in
a control, I try this

Private Sub pd_PrintPage(sender As Object, e As PrintPageEventArgs)
e.Grahpics = MyControl.MyGraphics
End Sub
When I do the problem is that e.Grahpics is read only.

How do I print what I already have ib memory without redrawing
everything on the e.Grahpics object?

Thanks, Ed,
Nov 20 '05 #1
2 1241
Hi,

I post a procedure that gets a windows or controls image from its
handle.

http://www.vb-helper.com/howto_net_g...dow_image.html

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e
As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage

e.Graphics.DrawImage(GetWindowPicture(PictureBox1. Handle.ToInt32), 0, 0)

End Sub

Ken

----------------------

"ECVerify.com" <go****@gencode.com> wrote in message
news:20**************************@posting.google.c om...
I have a Graphics object in a control that has an image I want to
print...I want to print my already made Graphics object that I use in
a control, I try this

Private Sub pd_PrintPage(sender As Object, e As PrintPageEventArgs)
e.Grahpics = MyControl.MyGraphics
End Sub
When I do the problem is that e.Grahpics is read only.

How do I print what I already have ib memory without redrawing
everything on the e.Grahpics object?

Thanks, Ed,

Nov 20 '05 #2
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:<OM**************@tk2msftngp13.phx.gbl>...
Hi,

I post a procedure that gets a windows or controls image from its
handle.

http://www.vb-helper.com/howto_net_g...dow_image.html

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e
As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage

e.Graphics.DrawImage(GetWindowPicture(PictureBox1. Handle.ToInt32), 0, 0)

End Sub

Ken

----------------------

"ECVerify.com" <go****@gencode.com> wrote in message
news:20**************************@posting.google.c om...
I have a Graphics object in a control that has an image I want to
print...I want to print my already made Graphics object that I use in
a control, I try this

Private Sub pd_PrintPage(sender As Object, e As PrintPageEventArgs)
e.Grahpics = MyControl.MyGraphics
End Sub
When I do the problem is that e.Grahpics is read only.

How do I print what I already have ib memory without redrawing
everything on the e.Grahpics object?

Thanks, Ed,


Thanks Ken,

Yes that is basically what I did,

Thanks again for your input,

Ed,
Nov 20 '05 #3

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

Similar topics

5
by: Mr. B | last post by:
This is driving me NUTZ!!! I've been screwing around on this for a week now. And I have tried to find examples similar to what I have (nada). Got lots of streaming a TXT file... bah! I am...
5
by: Patrick De Ridder | last post by:
How can I turn what I want to print 90 degrees using the logic below? Please tell me the code with which to make the modification. Many thanks, Patrick. using System.ComponentModel; using...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
4
by: Rob T | last post by:
I have a small VB program that has a printing module...very simple....and works great. However, If I try to print to a generic printer, I get the following error: "The data area passed to a...
7
by: DazedAndConfused | last post by:
I have a 8.5 x 11 landscape document with about 1/4 inch of space on the left and right where there is no print. The document displays perfect in print preview, but when I print it, about 1/2 inch...
3
by: D Witherspoon | last post by:
No matter what I do the default paper size is always either A3 or 11 by 8.5 .. Here is the code. Dim dlg As DialogResult pd.DocumentName = "Weld Image" Dim pkPaperSize As New...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
6
by: randy1200 | last post by:
I'm using Visual Studio 2005 and C#. I need to print a WinForm used for data entry as a graphic. In other words, I need to print the exact WinForm the user sees on the screen. I searched through...
6
by: Chris Dunaway | last post by:
The method for printing documents in .Net can be confusing, especially for newer users. I would like to create a way to simplify this process. My idea would be implemented using a PrintDocument...
4
by: DeWittds | last post by:
I have asked before and got little responce, So I try and try again. The code below prints the data in the same place but does not advance the page. I can see the lblnumber change but print in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.