469,609 Members | 1,115 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

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 2335
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by sachin | last post: by
1 post views Thread by Tim | last post: by
4 posts views Thread by Troy | last post: by
2 posts views Thread by gsb58 | last post: by
1 post views Thread by Richard MSL | last post: by
6 posts views Thread by David Stone | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.