keep the graphics

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

    keep the graphics

    Sorry, is there any way that after we draw some line or graphics on the
    windows form, after the windows minimized, the line and graphics won't
    dissappear?

    I'm appreciate for any reply, thank you
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: keep the graphics

    Jin,

    When paint something on the form, the form doesn't remember what you
    painted. Rather, when it needs to, the form repaints itself at regular
    intervals.

    What you need to do is store the information about where the line should
    be drawn on your form. Then, call the Invalidate method on your form. When
    you do that, it will cause a repaint. Then, from your form, you would
    override the OnPaint method or sign up for the Paint event. Then, in these
    methods, you would paint the line on your form according to the information
    you stored.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "jin" <jin@discussion s.microsoft.com > wrote in message
    news:67DF8A9A-6D02-4D68-A53F-0B1192110850@mi crosoft.com...[color=blue]
    > Sorry, is there any way that after we draw some line or graphics on the
    > windows form, after the windows minimized, the line and graphics won't
    > dissappear?
    >
    > I'm appreciate for any reply, thank you[/color]


    Comment

    • Bob Powell [MVP]

      #3
      Re: keep the graphics

      Check out the GDI+ FAQ.

      --
      Bob Powell [MVP]
      Visual C#, System.Drawing

      Ramuseco Limited .NET consulting


      Find great Windows Forms articles in Windows Forms Tips and Tricks


      Answer those GDI+ questions with the GDI+ FAQ


      All new articles provide code in C# and VB.NET.
      Subscribe to the RSS feeds provided and never miss a new article.





      "jin" <jin@discussion s.microsoft.com > wrote in message
      news:67DF8A9A-6D02-4D68-A53F-0B1192110850@mi crosoft.com...[color=blue]
      > Sorry, is there any way that after we draw some line or graphics on the
      > windows form, after the windows minimized, the line and graphics won't
      > dissappear?
      >
      > I'm appreciate for any reply, thank you[/color]


      Comment

      • g18c@hotmail.com

        #4
        Re: keep the graphics

        I've done this before (with MFC but still applies here) by overriding
        the OnPaint method, and blit a bitmap to the screen. If the user had
        changed any of the application data i would need to re-render the
        bitmap before letting OnPaint display it (instead it just showed a
        rendering message). Bitmaps are a good way of caching if the drawing
        process is intensive.

        Hope this helps

        Chris

        Comment

        Working...