Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How do I create graphics are same in different areas

How do I create graphics are same in different areas

Scheduled Pinned Locked Moved Visual Basic
graphicsquestiontutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BatUlzii
    wrote on last edited by
    #1

    ::Example code here: ---------------------------------------------------------------------------­----------------------------------- Private Function draw(ByVal g As Graphics) As Integer Dim sf As New SizeF g.MeasureString("hello world!", New Font("Arial", 9), sf) Return sf.Width End Function Private Sub pd_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pd.PrintPage draw(e.Graphics) End Sub Private Sub mySub() Dim g As Graphics ' What should I do here with g in order to get equal results from draw() functions ' in pd_PrintPage() and in mySub()? draw(g) End Sub Tell me please if it is possible.

    C 1 Reply Last reply
    0
    • B BatUlzii

      ::Example code here: ---------------------------------------------------------------------------­----------------------------------- Private Function draw(ByVal g As Graphics) As Integer Dim sf As New SizeF g.MeasureString("hello world!", New Font("Arial", 9), sf) Return sf.Width End Function Private Sub pd_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pd.PrintPage draw(e.Graphics) End Sub Private Sub mySub() Dim g As Graphics ' What should I do here with g in order to get equal results from draw() functions ' in pd_PrintPage() and in mySub()? draw(g) End Sub Tell me please if it is possible.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      mySub should call Invalidate() to force a paint event. Although, I see that neither of your other blocks of code is a paint event. What are you trying to do ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      B 1 Reply Last reply
      0
      • C Christian Graus

        mySub should call Invalidate() to force a paint event. Although, I see that neither of your other blocks of code is a paint event. What are you trying to do ?

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        B Offline
        B Offline
        BatUlzii
        wrote on last edited by
        #3

        how to create 600dpi graphics

        C 1 Reply Last reply
        0
        • B BatUlzii

          how to create 600dpi graphics

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Oh, OK. You can use a scale transform to make everything you draw, bigger. There may also be a DPI setting, but I'm not sure what that would achieve.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups