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

PrintPreviewControl / PrintPreviewDialog: Image location within the client area

Context: I have to print personal information on a preprinted form I've
never seen using a printer I've never seen. I want to use a control to
overlay the PrintPreview to indicate where I've printed. I want to use a
separate control in order to allow the user to drag the field to a different
position on the form so it doesn't have to come back for me to change the
code. I want to use the PrintPreview because it fits so naturally with
printing to the real printer. Note that one consequence of this strategy is
that I'll need to relocate the highlight as the PrintPreview is zoomed or
panned. Pretend that I'm using a label control with a transparent
background.

I can't find the position of the image within the PrintPreviewControl or the
PrintPreviewDialog. I've tried deriving classes from each. In the debugger
I can see several fields which are not referenced in the documentation and
which, not surprisingly, are not available to my code. One of them appears
to include the image size and location.

1. (How) can I get to the image location.

2. A control on top of the PrintPreviewControl shows the printed document
image through the label. A control on top of the PrintPreviewDialog (form)
shows the dialog's background through the label. Should I assume that the
Dialog approach is a dead end?

3. What else am I not seeing?

Thanks,
Ramsey
Jul 21 '05 #1
3 2528
Hi Ramsey,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the position of image
that is displayed on the PrintPreview control. If there is any
misunderstanding, please feel free to let me know.

I didn't find the property to get the position of the image yet. If you can
see some member that indicates the position of the print document image,
that must be a private member. Thus, we can use Reflection classes to get
the value of them. However, since this is not documented, it is not
recommended to do so. When the preview document is zoomed or scrolled, the
label will not move to new position accordingly.

Please check the following link for more information about reflection.

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemreflection.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Yep. That's the idea. And, sure, the control won't reposition itself, but
if I can position it originally, I can do it again.

Plan B is to add a highlight at the time I print the preview, but then
moving the highlight cannot be done by dragging, but must be done in another
window.

The dragging part is working. I just have no idea where I'm dragging from
or to!

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:L4**************@cpmsftngxa10.phx.gbl...
Hi Ramsey,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the position of image
that is displayed on the PrintPreview control. If there is any
misunderstanding, please feel free to let me know.

I didn't find the property to get the position of the image yet. If you can see some member that indicates the position of the print document image,
that must be a private member. Thus, we can use Reflection classes to get
the value of them. However, since this is not documented, it is not
recommended to do so. When the preview document is zoomed or scrolled, the
label will not move to new position accordingly.

Please check the following link for more information about reflection.

http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfsystemreflection.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
Hi Ramsey,

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #4

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

Similar topics

0
by: sachin | last post by:
How to sence click event on the document when two pages are displayed in PrintPreviewControl. How to identify which page is clicked Moreover can we hookup Vertical scroll bar to Next/Previous Page,...
0
by: Sachin | last post by:
Hello, I am trying to make a customized PrintPreviewDialog using PrintPreviewControl. Can any one please explain how to change the cursor only on the document that is displayed in the Preview...
1
by: Tim | last post by:
Hi, I want to use a PrintPreviewControl instead of the dialog which is too restrictive. I have found a basic tutorial but I have lots of other questions: 1. How do I implement next and...
4
by: Troy | last post by:
Hi all, Im a little new to ASP.NET. I'm looking to create an image viewer that zooms in, pretty common. But I need to draw a box on the 1:1 scale image and 'zoom in' on another picture box. ...
3
by: Ramsey Schaffnit | last post by:
Context: I have to print personal information on a preprinted form I've never seen using a printer I've never seen. I want to use a control to overlay the PrintPreview to indicate where I've...
2
by: gsb58 | last post by:
Hi! I seem to be missing something when using the PrintPreviewDialog. On a form I have a monthCalendar which, at runtime, will display all months of the year. Now I have routine for printing...
1
by: Richard MSL | last post by:
I was using a PrintPreviewDialog, and it previewed the file nicely, I could page through it, etc. But I could not control the printing, so I made my own form with a PrintPreviewControl on it, and...
0
by: madval | last post by:
How can I get the pages of printPreviewDialog or printPreviewControl as images (if possible without openning the dialog)?? I am printpreviewing the content of a richtextbox and I want to screenshot...
6
by: David Stone | last post by:
I have a simple question about the alt content of area elements within an image map: is it redundant to include phrases such as "link to..." or "jump to..."? My initial thought is 'yes', since...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.