Results 1 to 6 of 6

Thread: [02/03] Heavy GDI+ Question Regarding PRintPreview Control

  1. #1

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    [02/03] Heavy GDI+ Question Regarding PRintPreview Control

    Dear all,
    i have a form that contains a printpreview control that shows a print document on screen.

    now i want to make the user able of modifing some positions of objects on screen. (That is ok).

    he can select an object from the list of objects drawn on the document to reposition by mouse. i managed to create the code for dynamically showing and modifing the objects positions.

    my problem is that i can't translate mouse click positions over the preview control into a document relative position. (Due to difference of zoom factors).

    for example at zoom of 50% when the user click on the middle of the preview control, the selected position is differnce when he clicks the same mouse position but at zoom factor of 100%.

    I want to translate mouse click position clicked over the preview control on the form into an inside posint coordination related to the print document.

    my problem now is that my user selects a drop point and clicks over it with mouse, the object is not dropped correctly in the document due to zoom factors variations.

    i hope anyone can understand me in the first place.


    THank you in advance

    Waiting your kind Replies

    bst rgds
    Last edited by maged; May 24th, 2006 at 08:23 AM.

  2. #2

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: [02/03] Heave GDI+ Question Regarding PRintPreview Control

    any body ?????


    is it so hard ???

  3. #3

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: [02/03] Heave GDI+ Question Regarding PRintPreview Control

    anybody ????

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [02/03] Heavy GDI+ Question Regarding PRintPreview Control

    Maged, I am not sure if I will be able to help you or not, but it does sound like you would need to do a calculation on mouse position, taking into account the current zoom level... have you tried anything like this?

  5. #5

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: [02/03] Heavy GDI+ Question Regarding PRintPreview Control

    Dear kleinma,
    thank you for answering me. i haven't tried to do calculation because i am not sure about the graphics units conversions used in .net

    if you know any good links or articles that i can read i will be very glad to help.


    by the way i don't think the calculation is based on a linear equation because i have noticed the following :

    when i click on a point near the top left it has a smaller error offset than clicking on a bottom right point on the same document. !!!

  6. #6
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: [02/03] Heavy GDI+ Question Regarding PRintPreview Control

    IIRC the print page is drawn using a pixel size in tenths of a millimeter thus an A4 page is 2970 pixels long...?
    You need to take into account the zoom level, and also the offset of the start of the page relative to the print preview control - all in all a painful exercise...
    Maybe you could implement your own control (based on a picture box) to do the print preview?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width