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. Picture Control

Picture Control

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
9 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
    daavena
    wrote on last edited by
    #1

    Hi, I have problem with Picture control in my project. I am using 3 dialogs. When I put Picture control on my dialog and set properties: Type to Icon, Image is icon ID from resource so I see icon icon in the Picture control - everything looks ok. But when I build the program so I see different icon in the Picture control - I see a cursor icon(white arrow with question mark) instead of my icon from resource. This is definition of Picture control from my resource: ICON IDI_ICON2,IDC_STATIC_ICON,181,154,20,20,0 The value of IDI_ICON2 is 112 I tried create a new project with one dialog box. It was working without any problems. What am I doing wrong. Thanks.

    C 1 Reply Last reply
    0
    • D daavena

      Hi, I have problem with Picture control in my project. I am using 3 dialogs. When I put Picture control on my dialog and set properties: Type to Icon, Image is icon ID from resource so I see icon icon in the Picture control - everything looks ok. But when I build the program so I see different icon in the Picture control - I see a cursor icon(white arrow with question mark) instead of my icon from resource. This is definition of Picture control from my resource: ICON IDI_ICON2,IDC_STATIC_ICON,181,154,20,20,0 The value of IDI_ICON2 is 112 I tried create a new project with one dialog box. It was working without any problems. What am I doing wrong. Thanks.

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      No idea what could be wrong there but did you try changing the value of IDI_ICON2 from 112 to something else, for example to 1000?

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

      D 1 Reply Last reply
      0
      • C Code o mat

        No idea what could be wrong there but did you try changing the value of IDI_ICON2 from 112 to something else, for example to 1000?

        > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

        D Offline
        D Offline
        daavena
        wrote on last edited by
        #3

        Hi, thanks for reply. When I changed the value to 2000 so I see nothing. There is no icon.

        C 1 Reply Last reply
        0
        • D daavena

          Hi, thanks for reply. When I changed the value to 2000 so I see nothing. There is no icon.

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          Clean and rebuild your project and see if anything changes.

          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

          D 1 Reply Last reply
          0
          • C Code o mat

            Clean and rebuild your project and see if anything changes.

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

            D Offline
            D Offline
            daavena
            wrote on last edited by
            #5

            I cleaned the solution and rebuilt that againt - It's same - I see nothing.

            C 1 Reply Last reply
            0
            • D daavena

              I cleaned the solution and rebuilt that againt - It's same - I see nothing.

              C Offline
              C Offline
              Code o mat
              wrote on last edited by
              #6

              I see...did you maybe -by mistake- add your icon as cursor resource instead of icon resource, or maybe selected cursor -if possible- instead of icon for the picture control? Does the arrow with questionmark cursor thing appear again if you change the ID back to 112? I did some look around and 112 seems to be the resource ID of the standard "arrow with questionmark" mouse cursor, so my guess is that someone somewhere loads a cursor instead of an icon.

              > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

              modified on Saturday, February 28, 2009 2:39 PM

              D 1 Reply Last reply
              0
              • C Code o mat

                I see...did you maybe -by mistake- add your icon as cursor resource instead of icon resource, or maybe selected cursor -if possible- instead of icon for the picture control? Does the arrow with questionmark cursor thing appear again if you change the ID back to 112? I did some look around and 112 seems to be the resource ID of the standard "arrow with questionmark" mouse cursor, so my guess is that someone somewhere loads a cursor instead of an icon.

                > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

                modified on Saturday, February 28, 2009 2:39 PM

                D Offline
                D Offline
                daavena
                wrote on last edited by
                #7

                I checked it all over again - when I change the value to 2000 I see nothing, to 113 I se different cursor(pen). In the type properties there is value Icon. There are no curors in the my resource. I see the icon in the Icon folder in the Resource viewer(there are no cursors).

                C 1 Reply Last reply
                0
                • D daavena

                  I checked it all over again - when I change the value to 2000 I see nothing, to 113 I se different cursor(pen). In the type properties there is value Icon. There are no curors in the my resource. I see the icon in the Icon folder in the Resource viewer(there are no cursors).

                  C Offline
                  C Offline
                  Code o mat
                  wrote on last edited by
                  #8

                  Well, if you don't mind the workaround, i suggest setting the icon from code using CStatic::SetIcon[^] instead of using the resource...that should help, just use LoadIcon[^] or CWinApp::LoadIcon[^] and then set this to your static control. Don't forget to use DestroyIcon[^] once you are done with it. Your dialog's OnInitDialog[^] is a good place for setting the icon.

                  > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

                  modified on Saturday, February 28, 2009 3:34 PM

                  D 1 Reply Last reply
                  0
                  • C Code o mat

                    Well, if you don't mind the workaround, i suggest setting the icon from code using CStatic::SetIcon[^] instead of using the resource...that should help, just use LoadIcon[^] or CWinApp::LoadIcon[^] and then set this to your static control. Don't forget to use DestroyIcon[^] once you are done with it. Your dialog's OnInitDialog[^] is a good place for setting the icon.

                    > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

                    modified on Saturday, February 28, 2009 3:34 PM

                    D Offline
                    D Offline
                    daavena
                    wrote on last edited by
                    #9

                    SendDlgItemMessage(hDlg,IDC_LOGO, STM_SETIMAGE,(WPARAM)IMAGE_BITMAP,(LPARAM) LoadIcon(ghInstance,MAKEINTRESOURCE(IDI_ICON1))); I see nothing; GetLasterror returns - The specified resource type cannot be found in the image file. But this icon - IDI_ICON1 is there because I use it as icon for exe file and for title bar. I am giving up. Thanks for you time.

                    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