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. Bitmap sappear as different colors

Bitmap sappear as different colors

Scheduled Pinned Locked Moved C / C++ / MFC
graphicstutorialquestionlearning
15 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.
  • R Reagan Conservative

    I am using a small bitmap (10x15) on a dialog resource that shows up as a different color than black (a lighter shade of black, actually) on a different monitor. Both monitors have the same screen settings and both are running Windows 2000. Other resources on that dialog display as black on one monitor and the same on the other monitor. Anyone have any ideas how to possibly correct this anomaly? Thanks.

    John P.

    CPalliniC Offline
    CPalliniC Offline
    CPallini
    wrote on last edited by
    #2

    Palette? :confused:

    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

    In testa che avete, signor di Ceprano?

    R 1 Reply Last reply
    0
    • CPalliniC CPallini

      Palette? :confused:

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      R Offline
      R Offline
      Reagan Conservative
      wrote on last edited by
      #3

      If I look at the bitmap in a 'paint' program, the color looks fine (on the PC where the color on the dialog looks different). I don't believe the pallettes are different, but it's worth looking into I guess. thanks.

      John P.

      1 Reply Last reply
      0
      • R Reagan Conservative

        I am using a small bitmap (10x15) on a dialog resource that shows up as a different color than black (a lighter shade of black, actually) on a different monitor. Both monitors have the same screen settings and both are running Windows 2000. Other resources on that dialog display as black on one monitor and the same on the other monitor. Anyone have any ideas how to possibly correct this anomaly? Thanks.

        John P.

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

        As cpallini mentioned - a palette can be necessary depending on the pixel format/bit-depth of the bitmap and how you are drawing it. So, how is the bitmap being drawn and what format is it? :) Mark

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

        R 1 Reply Last reply
        0
        • M Mark Salsbery

          As cpallini mentioned - a palette can be necessary depending on the pixel format/bit-depth of the bitmap and how you are drawing it. So, how is the bitmap being drawn and what format is it? :) Mark

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

          R Offline
          R Offline
          Reagan Conservative
          wrote on last edited by
          #5

          The bitmap is being used by other owner-drawn dialogs and the color is fine. The bitmap is 10x10 pixels and is suppose to represent a 'phillips screw'. I use this bitmap in a non-owner drawn dialog as a static resource placed in specific locations on the dialog. I can not find a specific palette withing the project. All colors have been defined withing include files. When viewed on my PC at my desk, there is no change in color on this bitmap when I use them as static controls on the dialog. On the PC where the application is actually used, this bitmap is displayed in a color that is not as deep a black color as found on the desk PC. And as previously mentioned, the screen attributes are the same on both PCs and both run Windows 2000. So, the confusion remains as to why the bitmap shows up as two different shades of black. Any ideas why? Thanks.

          John P.

          M 1 Reply Last reply
          0
          • R Reagan Conservative

            The bitmap is being used by other owner-drawn dialogs and the color is fine. The bitmap is 10x10 pixels and is suppose to represent a 'phillips screw'. I use this bitmap in a non-owner drawn dialog as a static resource placed in specific locations on the dialog. I can not find a specific palette withing the project. All colors have been defined withing include files. When viewed on my PC at my desk, there is no change in color on this bitmap when I use them as static controls on the dialog. On the PC where the application is actually used, this bitmap is displayed in a color that is not as deep a black color as found on the desk PC. And as previously mentioned, the screen attributes are the same on both PCs and both run Windows 2000. So, the confusion remains as to why the bitmap shows up as two different shades of black. Any ideas why? Thanks.

            John P.

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

            jparken wrote:

            The bitmap is being used by other owner-drawn dialogs and the color is fine.

            Then I still ask - What code are you using to draw the bitmap? What format is the bitmap (bits-per-pixel and planes)? There must be something about the way you are handling the bitmap that differs from the working code :) Mark

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

            R 1 Reply Last reply
            0
            • M Mark Salsbery

              jparken wrote:

              The bitmap is being used by other owner-drawn dialogs and the color is fine.

              Then I still ask - What code are you using to draw the bitmap? What format is the bitmap (bits-per-pixel and planes)? There must be something about the way you are handling the bitmap that differs from the working code :) Mark

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

              R Offline
              R Offline
              Reagan Conservative
              wrote on last edited by
              #7

              The bitmap is included as a 'picture property' part of the dialog. I'm not 'drawing' the bitmap. All I do is place it in a location on the dialog resource.

              John P.

              M 1 Reply Last reply
              0
              • R Reagan Conservative

                The bitmap is included as a 'picture property' part of the dialog. I'm not 'drawing' the bitmap. All I do is place it in a location on the dialog resource.

                John P.

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

                Sorry for the confusion :) What is the "'picture property' part of the dialog"? You're NOT using a picture (static) control? Mark

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

                R 1 Reply Last reply
                0
                • M Mark Salsbery

                  Sorry for the confusion :) What is the "'picture property' part of the dialog"? You're NOT using a picture (static) control? Mark

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

                  R Offline
                  R Offline
                  Reagan Conservative
                  wrote on last edited by
                  #9

                  The picture property is a static control (defined with an IDC_xxxxx). If you select 'Picture' from the toolbar, it will default to IDC_STATIC. But the color on the picture (bitmap) is different when running the application on separate PCs. Hope this explains the problem more clearly. Thanks for your time.

                  John P.

                  M 1 Reply Last reply
                  0
                  • R Reagan Conservative

                    The picture property is a static control (defined with an IDC_xxxxx). If you select 'Picture' from the toolbar, it will default to IDC_STATIC. But the color on the picture (bitmap) is different when running the application on separate PCs. Hope this explains the problem more clearly. Thanks for your time.

                    John P.

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

                    hmm I can't imagine why it would draw differently on different PCs. Can you post the exact control resource code for the static control from the .RC file and any code you use to manipulate the control? Mark

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

                    R 1 Reply Last reply
                    0
                    • M Mark Salsbery

                      hmm I can't imagine why it would draw differently on different PCs. Can you post the exact control resource code for the static control from the .RC file and any code you use to manipulate the control? Mark

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

                      R Offline
                      R Offline
                      Reagan Conservative
                      wrote on last edited by
                      #11

                      From the .RC file:

                      CONTROL         197,IDC\_STATIC,"Static",SS\_BITMAP,12,15,10,10
                      CONTROL         197,IDC\_SCREW2,"Static",SS\_BITMAP,195,15,10,10
                      CONTROL         197,IDC\_SCREW3,"Static",SS\_BITMAP,195,55,10,10
                      CONTROL         197,IDC\_SCREW4,"Static",SS\_BITMAP,12,55,10,10
                      

                      And I don't manipulate the the static control once I have it placed on the dialog (which happens to be a numeric keypad). The bitmap is nothing more than a representation of a small phillips screw head. As I said in prior postings, this same bitmap is used throughout the total project of numerous dialogs, and all of them make use of this bitmap at the corners of the dialogs.

                      John P.

                      M 1 Reply Last reply
                      0
                      • R Reagan Conservative

                        From the .RC file:

                        CONTROL         197,IDC\_STATIC,"Static",SS\_BITMAP,12,15,10,10
                        CONTROL         197,IDC\_SCREW2,"Static",SS\_BITMAP,195,15,10,10
                        CONTROL         197,IDC\_SCREW3,"Static",SS\_BITMAP,195,55,10,10
                        CONTROL         197,IDC\_SCREW4,"Static",SS\_BITMAP,12,55,10,10
                        

                        And I don't manipulate the the static control once I have it placed on the dialog (which happens to be a numeric keypad). The bitmap is nothing more than a representation of a small phillips screw head. As I said in prior postings, this same bitmap is used throughout the total project of numerous dialogs, and all of them make use of this bitmap at the corners of the dialogs.

                        John P.

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

                        jparken wrote:

                        I don't manipulate the the static control once I have it placed on the dialog

                        Don't you set a bitmap to the control?

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

                        R 1 Reply Last reply
                        0
                        • M Mark Salsbery

                          jparken wrote:

                          I don't manipulate the the static control once I have it placed on the dialog

                          Don't you set a bitmap to the control?

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

                          R Offline
                          R Offline
                          Reagan Conservative
                          wrote on last edited by
                          #13

                          Maybe I don't understand the question, but I select and place the bitmap on the dialog in the location I desire. Is that not setting the bitmap to the control? I set the control name in the Properties box, instead of accepting the standard IDC_STATIC for all four of them.

                          John P.

                          M 1 Reply Last reply
                          0
                          • R Reagan Conservative

                            Maybe I don't understand the question, but I select and place the bitmap on the dialog in the location I desire. Is that not setting the bitmap to the control? I set the control name in the Properties box, instead of accepting the standard IDC_STATIC for all four of them.

                            John P.

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

                            ACK never mind - You showed the bitmap ID in the resource :doh: Well, I can't imagine why it would draw different! The bitmap is 10x15 and you can tell the shade of black is different? :) Good eye! What if you make a new bitmap, filled with black, and substitute it in the resource. Does that show as black or gray? Mark

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

                            R 1 Reply Last reply
                            0
                            • M Mark Salsbery

                              ACK never mind - You showed the bitmap ID in the resource :doh: Well, I can't imagine why it would draw different! The bitmap is 10x15 and you can tell the shade of black is different? :) Good eye! What if you make a new bitmap, filled with black, and substitute it in the resource. Does that show as black or gray? Mark

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

                              R Offline
                              R Offline
                              Reagan Conservative
                              wrote on last edited by
                              #15

                              I haven't tried that. It will take a while to do though. This app is running on a flight simulator, so I can only try this when the simulator is not in use, so it may be next week before I can get back to you. Thanks for all your assistance!

                              John P.

                              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