bitmaps
-
hi i want to display the bitmap on the picture box in visual c++.code i had used is below if the loadbitmap the id of bitmap present in the resource is passed it loads and displays but if the id is not in the resource then it does not displays the bitmap. bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); if(bitmap==NULL) //it displays the fail MessageBox("fail "); m_pic.SetBitmap(bitmap); i want to display the image whose id is not present in the resource. how to do that. ddd
-
hi i want to display the bitmap on the picture box in visual c++.code i had used is below if the loadbitmap the id of bitmap present in the resource is passed it loads and displays but if the id is not in the resource then it does not displays the bitmap. bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); if(bitmap==NULL) //it displays the fail MessageBox("fail "); m_pic.SetBitmap(bitmap); i want to display the image whose id is not present in the resource. how to do that. ddd
if youwant show a bimap file , you can use CImage Class.
-
hi i want to display the bitmap on the picture box in visual c++.code i had used is below if the loadbitmap the id of bitmap present in the resource is passed it loads and displays but if the id is not in the resource then it does not displays the bitmap. bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); if(bitmap==NULL) //it displays the fail MessageBox("fail "); m_pic.SetBitmap(bitmap); i want to display the image whose id is not present in the resource. how to do that. ddd
if you want show a bitmap file ,like c:\\ff.bmp, you can use CImage MFC Class(VC++7 ).
-
hi i want to display the bitmap on the picture box in visual c++.code i had used is below if the loadbitmap the id of bitmap present in the resource is passed it loads and displays but if the id is not in the resource then it does not displays the bitmap. bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); if(bitmap==NULL) //it displays the fail MessageBox("fail "); m_pic.SetBitmap(bitmap); i want to display the image whose id is not present in the resource. how to do that. ddd
tasleem143 wrote: bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); What's this?
MAKEINTRESOURCE()
does not take a string for its argument. In the project'sresource.h
file:#define IDC_MYBITMAP 1234 // or some other appropriate value
In the project's .rc file:
IDC_MYBITMAP BITMAP DISCARDABLE "c:\\ff.bmp"
In the .cpp file:
HBITMAP hBitmap = LoadBitmap(NULL, MAKEINTRESOURCE(IDC_MYBITMAP));
if (NULL == hBitmap)
AfxMessageBox("LoadBitmap() failed.");
else
m_pic.SetBitmap(hBitmap);
"One must learn from the bite of the fire to leave it alone." - Native American Proverb