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. Graphics
  4. How to use OnPaint() ??? :(

How to use OnPaint() ??? :(

Scheduled Pinned Locked Moved Graphics
graphicshelpquestioncomtutorial
2 Posts 2 Posters 4 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.
  • C Offline
    C Offline
    Chintan Desai
    wrote on last edited by
    #1

    Hi Expert(s), I need to draw 100 line with e.Graphics.DrawLine() command. Problem is that, that when i minimize my window all 100 line are vanish. I learn some topic on device context but not got idea how to do.Wht i wanna to do is that i am drawing line from many differenct event says with 10-20 mouse down events of picture box.So here how do i write code in my OnPaoint() .Pls Pls giv me solution. Help wud b really appreciated.

    Regards Chintan www.visharadsoft.com (Nothing is so purify as KNOWLEDGE)

    M 1 Reply Last reply
    0
    • C Chintan Desai

      Hi Expert(s), I need to draw 100 line with e.Graphics.DrawLine() command. Problem is that, that when i minimize my window all 100 line are vanish. I learn some topic on device context but not got idea how to do.Wht i wanna to do is that i am drawing line from many differenct event says with 10-20 mouse down events of picture box.So here how do i write code in my OnPaoint() .Pls Pls giv me solution. Help wud b really appreciated.

      Regards Chintan www.visharadsoft.com (Nothing is so purify as KNOWLEDGE)

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      You need to store any information you need to redraw all the lines when you receive the WM_PAINT notification. For a DC to do the drawing to, you can use the BeginPaint/EndPaint APIs or get a DC for the window and handle the validating of the update region of the window yourself. What language are you coding in? Mark

      "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

      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