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. C#
  4. equivalent of control.CreateGraphics() for CF

equivalent of control.CreateGraphics() for CF

Scheduled Pinned Locked Moved C#
helpquestion
7 Posts 3 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.
  • D Offline
    D Offline
    donkaiser
    wrote on last edited by
    #1

    Hello i need to convert a control.CreateGraphics() for my app. VS2005 gave me a runtime error saying that it's not supported for Compact framework. Is there anyway to bypass that? Donkaiser

    D G 3 Replies Last reply
    0
    • D donkaiser

      Hello i need to convert a control.CreateGraphics() for my app. VS2005 gave me a runtime error saying that it's not supported for Compact framework. Is there anyway to bypass that? Donkaiser

      D Offline
      D Offline
      donkaiser
      wrote on last edited by
      #2

      Oh I want to create graphics components on a panel. Donkaiser

      1 Reply Last reply
      0
      • D donkaiser

        Hello i need to convert a control.CreateGraphics() for my app. VS2005 gave me a runtime error saying that it's not supported for Compact framework. Is there anyway to bypass that? Donkaiser

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        As far as I can see you should be able to create a Graphics object using the Handle of the control. --- b { font-weight: normal; }

        O 1 Reply Last reply
        0
        • G Guffa

          As far as I can see you should be able to create a Graphics object using the Handle of the control. --- b { font-weight: normal; }

          O Offline
          O Offline
          os00
          wrote on last edited by
          #4

          Unfortunatelly you can't.. When you make something like this : Graphics g = Graphics.FromHdc(panel1.Handle); It throws an exception "ArgumentException - Value does not fall within the expected range". And that's all. I have the same problem like donkaiser. I'd like to draw something on a tabControl or a panel and I don't know how.

          D 1 Reply Last reply
          0
          • O os00

            Unfortunatelly you can't.. When you make something like this : Graphics g = Graphics.FromHdc(panel1.Handle); It throws an exception "ArgumentException - Value does not fall within the expected range". And that's all. I have the same problem like donkaiser. I'd like to draw something on a tabControl or a panel and I don't know how.

            D Offline
            D Offline
            donkaiser
            wrote on last edited by
            #5

            I used the paint event of the tab. but my problem is that i need to update the drawing color according to my input data. how to raise the paint event again is still a mystery. I bypassed the problem with panel.invalidate() but now i have flickering problems. Donkaiser

            G 1 Reply Last reply
            0
            • D donkaiser

              Hello i need to convert a control.CreateGraphics() for my app. VS2005 gave me a runtime error saying that it's not supported for Compact framework. Is there anyway to bypass that? Donkaiser

              D Offline
              D Offline
              donkaiser
              wrote on last edited by
              #6

              I try to implement double buffer but i can't get the handle of the SetStyle method this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); VS2005 give me the error saying that SetStyle and ControlStyles is not contained in the definition of the form. how can i get the handle on this function to use on a panel to prevent flickering? Donkaiser

              1 Reply Last reply
              0
              • D donkaiser

                I used the paint event of the tab. but my problem is that i need to update the drawing color according to my input data. how to raise the paint event again is still a mystery. I bypassed the problem with panel.invalidate() but now i have flickering problems. Donkaiser

                G Offline
                G Offline
                Guffa
                wrote on last edited by
                #7

                Invalidating the control is the proper way of making it redraw itself. --- b { font-weight: normal; }

                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