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. Two noob questions on GDI

Two noob questions on GDI

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsperformancequestion
10 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.
  • L Offline
    L Offline
    Lord Kixdemp
    wrote on last edited by
    #1

    Hello everyone! Here are my questions: 1) When drawing ellipses, rectangles, lines, et cetera, how do you select a color? I can't use SetDCPenColor() because they're not supported on Win9x/ME. And I'm on Win3.1. :) 2) How do you free memory from a HBITMAP? Thanks in advance!

    Windows Calculator told me I will die at 28. :(

    M 1 Reply Last reply
    0
    • L Lord Kixdemp

      Hello everyone! Here are my questions: 1) When drawing ellipses, rectangles, lines, et cetera, how do you select a color? I can't use SetDCPenColor() because they're not supported on Win9x/ME. And I'm on Win3.1. :) 2) How do you free memory from a HBITMAP? Thanks in advance!

      Windows Calculator told me I will die at 28. :(

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

      Lord Kixdemp wrote:

      1. When drawing ellipses, rectangles, lines, et cetera, how do you select a color?

      Create a pen and a brush.  Select them into the DC you're going to draw on. The pen will be used for the outline, the brush for the interior.

      Lord Kixdemp wrote:

      1. How do you free memory from a HBITMAP?

      DeleteObject() Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      H 1 Reply Last reply
      0
      • M Mark Salsbery

        Lord Kixdemp wrote:

        1. When drawing ellipses, rectangles, lines, et cetera, how do you select a color?

        Create a pen and a brush.  Select them into the DC you're going to draw on. The pen will be used for the outline, the brush for the interior.

        Lord Kixdemp wrote:

        1. How do you free memory from a HBITMAP?

        DeleteObject() Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

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

        I dont know why you got vote 3?

        M L 2 Replies Last reply
        0
        • H Hamid Taebi

          I dont know why you got vote 3?

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

          Doesn't matter to me.  If the OP needs more info then (s)he's free to ask. Explaining all of the basics of GDI (which is well documented) here is kind of beyond the scope of this forum. :) Cheers, Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          1 Reply Last reply
          0
          • H Hamid Taebi

            I dont know why you got vote 3?

            L Offline
            L Offline
            Lord Kixdemp
            wrote on last edited by
            #5

            Mark replied my question in its entirety, I don't know why someone voted 3... I didn't even know there was a voting system until Hamid said that and I figured it out. o_O *Is voting... takes some time*

            Windows Calculator told me I will die at 28. :(

            H 1 Reply Last reply
            0
            • L Lord Kixdemp

              Mark replied my question in its entirety, I don't know why someone voted 3... I didn't even know there was a voting system until Hamid said that and I figured it out. o_O *Is voting... takes some time*

              Windows Calculator told me I will die at 28. :(

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

              Yeah you can of 1 to 5 give to someone (like 5 to me:laugh:)

              L 1 Reply Last reply
              0
              • H Hamid Taebi

                Yeah you can of 1 to 5 give to someone (like 5 to me:laugh:)

                L Offline
                L Offline
                Lord Kixdemp
                wrote on last edited by
                #7

                Do you like, win something with high scores? ;P

                Windows Calculator told me I will die at 28. :(

                H 1 Reply Last reply
                0
                • L Lord Kixdemp

                  Do you like, win something with high scores? ;P

                  Windows Calculator told me I will die at 28. :(

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

                  For win we need to write a good article and submit it on the codeproject.(I told you because it's first time that you are using of vote so I was thinking you start with 5:-D Except it I like to ask a question of you whats the meaning of your Signature I saw it already?

                  L 1 Reply Last reply
                  0
                  • H Hamid Taebi

                    For win we need to write a good article and submit it on the codeproject.(I told you because it's first time that you are using of vote so I was thinking you start with 5:-D Except it I like to ask a question of you whats the meaning of your Signature I saw it already?

                    L Offline
                    L Offline
                    Lord Kixdemp
                    wrote on last edited by
                    #9

                    Good article? Hmm... I've got a great idea in mind. So what prize do you win? :) And, exactly how you read it - the Windows calculator told me I'll die at age 28. I was doing experiments with my age, date of birth and other similar stuff on it, and it suddenly came up with that number... The thing is, a couple of months before that a friend told me the same thing. Coincidence or reality? Only destiny will know... :laugh::laugh:

                    Windows Calculator told me I will die at 28. :(

                    H 1 Reply Last reply
                    0
                    • L Lord Kixdemp

                      Good article? Hmm... I've got a great idea in mind. So what prize do you win? :) And, exactly how you read it - the Windows calculator told me I'll die at age 28. I was doing experiments with my age, date of birth and other similar stuff on it, and it suddenly came up with that number... The thing is, a couple of months before that a friend told me the same thing. Coincidence or reality? Only destiny will know... :laugh::laugh:

                      Windows Calculator told me I will die at 28. :(

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

                      Lord Kixdemp wrote:

                      Good article? Hmm... I've got a great idea in mind.

                      Good luck.

                      Lord Kixdemp wrote:

                      Coincidence or reality? Only destiny will know

                      I dont like think to it I am because I can think.;)

                      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