Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Jeddah, Saudi Arabia
    Posts
    243
    Thanks
    0
    Thanked 1 Time in 1 Post

    Printing Graphics (VB .NET)

    I want to center a graphic on a printed page. I have struggled to work out the dimensions of the Image in a picturebox and convert them to 100ths of an inch so I can center it on a printed page.

    Can ANYBODY tell me how to do the conversion between pixels (image) and 100ths of an inch (printer)? I don't want to lose what little hair I have left.

    Also, does anybody know how I can tell the true dimensions of a page? I know that most printers cannot print on the whole page. Is there any way to find out the actual printable area of the page?

    Any help will be greatly appreciated as always.

    Regards,

    Kevin Bell

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing Graphics (VB .NET)

    Kev,
    Would your app benefit from a bit of OLE to Word? You could

    1) create a hidden doc
    2) paste the graphic
    3) set pic wrapping style to "In line with text"
    4) center the line (Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter)
    5) center the page vertically (Activedocument.PageSetup.VerticalAlignment = wdAlignVerticalCenter
    6) print
    7) cleanup

    That way you don't have to worry about printable page area, etc. Just a thought...
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Jeddah, Saudi Arabia
    Posts
    243
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Printing Graphics (VB .NET)

    I could use Word to print but my application may be installed on computers that don't have Office.

    It sounds like it should be a simple task converting from Image dimensions to printed page dimensions but I just can't find an example.

    Thanks for the thought anyway Kev.

    Cheers,

    Kevin Bell

Posting Permissions

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