Go4Expert Founder
5Feb2007,11:17   #31
shabbir's Avatar
Quote:
Originally Posted by lplover2k
it's not generated... i am getting error that it is missing
If its not generated delete the line wallpaper.h
Go4Expert Member
9Feb2007,02:09   #32
lplover2k's Avatar
when u say "Add a picture Box to your application"
is it the "picture" control??

the types available for are "frame","icon","bitmap","rectangle"Enhanced metafile"... still don't see "ownerdrawn"..... and where do i inlcude "picture.h" in my dialog class?
Go4Expert Founder
9Feb2007,09:28   #33
shabbir's Avatar
Quote:
Originally Posted by lplover2k
when u say "Add a picture Box to your application"
is it the "picture" control??
Yes.

Quote:
Originally Posted by lplover2k
the types available for are "frame","icon","bitmap","rectangle"Enhanced metafile"... still don't see "ownerdrawn"..... and where do i inlcude "picture.h" in my dialog class?
Go through the tabs of the property window and you will see a checkbox of ownerdraw.
Go4Expert Member
9Feb2007,15:12   #34
lplover2k's Avatar
there's no "ownerdraw"... neither in styles nor extended styles too...




thanks for quick responses btw
Go4Expert Founder
9Feb2007,15:36   #35
shabbir's Avatar
You dont need to convert the style to owner draw and it will work perfectly fine. I have edited the article for the errors. Thanks for pointing that out.
Go4Expert Member
9Feb2007,23:27   #36
lplover2k's Avatar
thanks very much!!! i have finally managed to use it!!! this is a great piece of code !!! it's the simplest method to load bitmap!!! thanks !!!

i am glad i was helpful for your code correction

one question is there a way to load jpeg??
Go4Expert Founder
10Feb2007,09:36   #37
shabbir's Avatar
Quote:
Originally Posted by lplover2k
one question is there a way to load jpeg??
You need GDI for that. I am planning to write one article on that but its lack of time at this moment.
Go4Expert Member
10Feb2007,11:51   #38
lplover2k's Avatar
cool i am impatient and thaNKs again
Newbie Member
9Aug2007,12:58   #39
abdul_khathar's Avatar
hi Shabbir!

In MFC application (Dialog based or Cform view), if i load bitmap image in the background, its taking more memory.. here is my coding..
Code:
void CDlg_Splash::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	HBITMAP m_Bmap;
	CRect rect;
	HDC memdc;
	
	CString m_ifilename1;
	
	m_ifilename1 = "C:\\test.bmp";
	
	GetClientRect(&rect);
	
	m_Bmap=(HBITMAP)::LoadImage(NULL,m_ifilename1,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
	memdc=::CreateCompatibleDC(dc.m_hDC);
	::SelectObject(memdc,m_Bmap);
	
	BitBlt(dc.m_hDC,0,0,rect.right,rect.bottom,memdc,0,0,SRCCOPY); 
	DeleteObject(m_Bmap);
	DeleteObject(memdc);
}
is it correct ? and also let me know is there any memory leakage?
is it possible to load jpeg image in MFC dialog? (to avoid more memory usage)

Thanks in Advance...





Abdul Khathar A

Last edited by shabbir; 9Aug2007 at 17:22.. Reason: Code block
Go4Expert Founder
9Aug2007,14:22   #40
shabbir's Avatar
You don't need to load the image in the Paint but can have the image loaded in the constructor and just display / Paint in the OnPaint