Another Printing Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anne DeBlois

    #1

    Another Printing Question

    Hi,

    I am currently testing the printing features of Visual Studio 2005 (VB.NET)
    We want to release a database application that prints label pages. The
    labels must contain a picture box.

    I found this code to print an image:

    e.Graphics.Draw Image(Image.Fro mFile("c:\\dev\ \Projects\\Impr ession\\merci.p ng"),
    20, 750)

    With this code, the picture will print with its original dimensions. Is it
    possible to change this line with a picturebox or any control that allows us
    to resize the image (and keep its proportions) within a limited space?

    Thanks in advance!

    ANNE DEBLOIS


  • Herfried K. Wagner [MVP]

    #2
    Re: Another Printing Question

    "Anne DeBlois" <annedeblois@co mmunity.nospams chrieb:
    I am currently testing the printing features of Visual Studio 2005
    (VB.NET) We want to release a database application that prints label
    pages. The labels must contain a picture box.
    >
    I found this code to print an image:
    >
    e.Graphics.Draw Image(Image.Fro mFile("c:\\dev\ \Projects\\Impr ession\\merci.p ng"),
    20, 750)
    >
    With this code, the picture will print with its original dimensions. Is it
    possible to change this line with a picturebox or any control that allows
    us to resize the image (and keep its proportions) within a limited space?
    You can basically pass the scaled height and width to 'DrawImage'. Note
    that backslashes inside string literals must not be escaped in VB.NET.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Anne DeBlois

      #3
      Re: Another Printing Question


      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.ata écrit dans le
      message de news:
      You can basically pass the scaled height and width to 'DrawImage'. Note
      that backslashes inside string literals must not be escaped in VB.NET.
      You mean I can pass parameters to the DrawImage method?

      As for the escaped backslashes, I had to do it because I got a first chance
      exception (FileNotFound) using "simple" backslashes when compiling...
      Someone suggested that I escape them.

      Thanks!

      A.D.


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Another Printing Question

        "Anne DeBlois" <annedeblois@co mmunity.nospams chrieb:
        >You can basically pass the scaled height and width to 'DrawImage'. Note
        >that backslashes inside string literals must not be escaped in VB.NET.
        >
        You mean I can pass parameters to the DrawImage method?
        Yes, just check out the different overloads in the documentation or the
        object browser.
        As for the escaped backslashes, I had to do it because I got a first
        chance exception (FileNotFound) using "simple" backslashes when
        compiling... Someone suggested that I escape them.
        Sorry, but that's nonsense for VB.NET -- are you sure you are using VB.NET?!

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://classicvb.org/petition/>

        Comment

        • Anne DeBlois

          #5
          Re: Another Printing Question


          "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.ata écrit dans le
          message de news: eP1bmD6nGHA.344 0@TK2MSFTNGP04. phx.gbl...
          "Anne DeBlois" <annedeblois@co mmunity.nospams chrieb:
          >>You can basically pass the scaled height and width to 'DrawImage'. Note
          >>that backslashes inside string literals must not be escaped in VB.NET.
          >>
          >You mean I can pass parameters to the DrawImage method?
          >
          Yes, just check out the different overloads in the documentation or the
          object browser.
          Thank you very much!
          >As for the escaped backslashes, I had to do it because I got a first
          >chance exception (FileNotFound) using "simple" backslashes when
          >compiling... Someone suggested that I escape them.
          >
          Sorry, but that's nonsense for VB.NET -- are you sure you are using
          VB.NET?!
          Of course, I am using VB.NET in VS2005. And yeah, that's a nonsense but it
          got me rid of that filenotfound exception at that time.

          Anne


          Comment

          Working...