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 / C++ / MFC
  4. Hatched Brushes + a Scrolling View = Wacky Lines

Hatched Brushes + a Scrolling View = Wacky Lines

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiographicshelptutorialquestion
2 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.
  • D Offline
    D Offline
    D D de Kerf
    wrote on last edited by
    #1

    Hi, I've written a document-view-application which draws boxes with fillings. I draw the fillings using a CRect and filling that with a hatched brush (HS_BDIAGONAL, HS_CROSS and so forth).... All works well until I start scrolling. It looks as if the view just draws the part of the document in the view that was invisible, but became visible because of the scroll... It also looks as though the brush's origin just takes the first visible point to start drawing instead of really using the coordinates of the rect it fills (because the top part of the box was, at the time, outside the viewport)... This results into wacky lines like this picture: http://hioforum.ftn.hsbrabant.nl/data/wacky\_lines.jpg Any idea of how to fix this? I don't like rewriting to code to manually drawing the lines, but of course it is an option.... Structured programming vs. chaotic mind boggling

    J 1 Reply Last reply
    0
    • D D D de Kerf

      Hi, I've written a document-view-application which draws boxes with fillings. I draw the fillings using a CRect and filling that with a hatched brush (HS_BDIAGONAL, HS_CROSS and so forth).... All works well until I start scrolling. It looks as if the view just draws the part of the document in the view that was invisible, but became visible because of the scroll... It also looks as though the brush's origin just takes the first visible point to start drawing instead of really using the coordinates of the rect it fills (because the top part of the box was, at the time, outside the viewport)... This results into wacky lines like this picture: http://hioforum.ftn.hsbrabant.nl/data/wacky\_lines.jpg Any idea of how to fix this? I don't like rewriting to code to manually drawing the lines, but of course it is an option.... Structured programming vs. chaotic mind boggling

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      GDI is something I know close to zero about, but seems like SetBrushOrgEx is what you're looking for. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      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