Simple Picture Control Usage
-
Hello. I have added a picture control to my dialog application resource file. I dont know how to access it at run time. I thought you would need a pointer, in the same way you access a Edit control: CEdit *p = GetDlgItem(IDC_EDT); p->whatever, etc. So I need a pointer to the control I assume in order to send an image to it. Can anyone help. Jerry
-
Hello. I have added a picture control to my dialog application resource file. I dont know how to access it at run time. I thought you would need a pointer, in the same way you access a Edit control: CEdit *p = GetDlgItem(IDC_EDT); p->whatever, etc. So I need a pointer to the control I assume in order to send an image to it. Can anyone help. Jerry
Try a pointer to a CStatic object :) Mark
-
Try a pointer to a CStatic object :) Mark
Ok.
-
Ok.
That is the type of control placed on the dialog. You can set a bitmap into it in the designer or at runtime with CStatic::SetBitmap()
-
Hello. I have added a picture control to my dialog application resource file. I dont know how to access it at run time. I thought you would need a pointer, in the same way you access a Edit control: CEdit *p = GetDlgItem(IDC_EDT); p->whatever, etc. So I need a pointer to the control I assume in order to send an image to it. Can anyone help. Jerry
By default, the control has an id of
IDC_STATIC
. Change that to something else. Then use ClassWizard (Ctrl+W) to associate aCStatic
object to that control. Then you can call theSetBitmap()
method.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
By default, the control has an id of
IDC_STATIC
. Change that to something else. Then use ClassWizard (Ctrl+W) to associate aCStatic
object to that control. Then you can call theSetBitmap()
method.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
Thank you for your help. Jerry
-
Hello. I have added a picture control to my dialog application resource file. I dont know how to access it at run time. I thought you would need a pointer, in the same way you access a Edit control: CEdit *p = GetDlgItem(IDC_EDT); p->whatever, etc. So I need a pointer to the control I assume in order to send an image to it. Can anyone help. Jerry
Static control is good for show picture but why you want to use Edit Ctrl
WhiteSky