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. The Windows GDI and Regions

The Windows GDI and Regions

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
3 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.
  • T Offline
    T Offline
    TheDelChop
    wrote on last edited by
    #1

    Hola friends, I'm working with a Dialog Box that has a rectangle associated with it so that I may draw in it. However, I am interested in adding regions to the rectangle, which I don't seem to have too much trouble doing. However, once I add my regions (three) all of the code within my WM_PAINT message seems to be constricted to drawing within the last region. Does anyone know what happens to the DC when I create a region, and does anybody have any suggestions on how I might be able to change it back to the entire rectangle, like it was originally set? Thanks, Joe

    S H 2 Replies Last reply
    0
    • T TheDelChop

      Hola friends, I'm working with a Dialog Box that has a rectangle associated with it so that I may draw in it. However, I am interested in adding regions to the rectangle, which I don't seem to have too much trouble doing. However, once I add my regions (three) all of the code within my WM_PAINT message seems to be constricted to drawing within the last region. Does anyone know what happens to the DC when I create a region, and does anybody have any suggestions on how I might be able to change it back to the entire rectangle, like it was originally set? Thanks, Joe

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      Show some code. I suspect you need to use the CombineRgn function with RGN_OR set in fnCombineMode to make a combined region and then select that into the DC.

      Steve

      1 Reply Last reply
      0
      • T TheDelChop

        Hola friends, I'm working with a Dialog Box that has a rectangle associated with it so that I may draw in it. However, I am interested in adding regions to the rectangle, which I don't seem to have too much trouble doing. However, once I add my regions (three) all of the code within my WM_PAINT message seems to be constricted to drawing within the last region. Does anyone know what happens to the DC when I create a region, and does anybody have any suggestions on how I might be able to change it back to the entire rectangle, like it was originally set? Thanks, Joe

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        I agree with Steve I think you need to CombineRgn


        WhiteSky


        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