how to load bitmap on picture ctrl
-
i am trying like this but this give reference error please reply ASAP CBitmap *bitmap1=(CBitmap *)GetDlgItem(IDC_STATIC1); bitmap1->LoadBitmap(IDB_BITMAP1); Bankey Khandelwal Software Engineer
-
i am trying like this but this give reference error please reply ASAP CBitmap *bitmap1=(CBitmap *)GetDlgItem(IDC_STATIC1); bitmap1->LoadBitmap(IDB_BITMAP1); Bankey Khandelwal Software Engineer
Bankey Khandelwal wrote:
CBitmap *bitmap1=(CBitmap *)GetDlgItem(IDC_STATIC1); bitmap1->LoadBitmap(IDB_BITMAP1);
GetDlgItem(...)
returns aCWnd*
. You are trying to cast it to a bitmap. This is wrong. You should do it like this...CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
CStatic *pStatic = (CStatic*)GetDlgItem(IDC_STATIC1);
pStatic->SetBitmap(bmp);
Nibu thomas Software Developer
-
i am trying like this but this give reference error please reply ASAP CBitmap *bitmap1=(CBitmap *)GetDlgItem(IDC_STATIC1); bitmap1->LoadBitmap(IDB_BITMAP1); Bankey Khandelwal Software Engineer
-
Bankey Khandelwal wrote:
CBitmap *bitmap1=(CBitmap *)GetDlgItem(IDC_STATIC1); bitmap1->LoadBitmap(IDB_BITMAP1);
GetDlgItem(...)
returns aCWnd*
. You are trying to cast it to a bitmap. This is wrong. You should do it like this...CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
CStatic *pStatic = (CStatic*)GetDlgItem(IDC_STATIC1);
pStatic->SetBitmap(bmp);
Nibu thomas Software Developer
thanks you, it is loading but not show on button where is i wrong please reply Bankey Khandelwal Software Engineer
-
thanks you, it is loading but not show on button where is i wrong please reply Bankey Khandelwal Software Engineer
Bankey Khandelwal wrote:
not show on button
Is it a button! or Is it a Static!
Nibu thomas Software Developer
-
i am trying like this but this give reference error please reply ASAP CBitmap *bitmap1=(CBitmap *)GetDlgItem(IDC_STATIC1); bitmap1->LoadBitmap(IDB_BITMAP1); Bankey Khandelwal Software Engineer
Set the type of button as bitmap and perform the following : (here m_bit is an object of CBitmap , m_btnStart is the variable for CBitmapButton) m_bit1.LoadBitmap(IDB_BMPSTART); HBITMAP hBit1 = (HBITMAP) m_bit1.GetSafeHandle(); m_btnStart.SetBitmap(hBit1); // Use m_btnStart.SizeToContent() if you want to set the size of the button to that of the image being displayed on it (open the resource editor and copy the .gif image to the bitmap image in the resource editor) *******and yes on the picture control you have to set the type as bitmap and pass the image name of the bitmap in the IMAGE option of resource editor Vision is Always important and so is your ATTITUDE. Wishes. Anshuman Dandekar -- modified at 5:31 Thursday 2nd March, 2006
-
Bankey Khandelwal wrote:
not show on button
Is it a button! or Is it a Static!
Nibu thomas Software Developer
it is static Bankey Khandelwal Software Engineer
-
it is static Bankey Khandelwal Software Engineer
Your static control must have the style
SS_BITMAP
(for bitmap) orSS_ICON
(for icon).
Nibu thomas Software Developer
-
Your static control must have the style
SS_BITMAP
(for bitmap) orSS_ICON
(for icon).
Nibu thomas Software Developer
ya there is type bitmap but there is no style property like bitmap etc. Bankey Khandelwal Software Engineer
-
ya there is type bitmap but there is no style property like bitmap etc. Bankey Khandelwal Software Engineer
Bankey Khandelwal wrote:
ya there is type bitmap
Yes that is the one.
Nibu thomas Software Developer
-
thanks you, it is loading but not show on button where is i wrong please reply Bankey Khandelwal Software Engineer
You said it is loading but not show on button,the reason is u have to check the button properites as ownerdraw. It works now Kiranmaye