-
March 13th, 2000, 02:14 AM
#1
How exactly do i use OnNcPaint() ???
Hi...
im trying to draw my own window with bitmap as the frame...
this is what i did so far:
CMyDlg::CMyDlg()
{
m_FxBmp.LoadBitmap(IDB_FRAME_H);
}
void CMyDlg::OnNcPaint()
{
CRect NcRect;
GetWindowRect(&NcRect) ;
CDC *pDC=GetDC();
m_FxBmp.DrawTransparent(pDC,NcRect.left,NcRect.right,RGB(0,0,0));
//m_FxBmp is my class derived from CBitmap where i draw tranparent bmp's
ReleaseDC(pDC);
CWnd::OnNcPaint();
}
But all this doesnt work... i can see the bitmap drawn...
what am i missing here??
Any suggestions?
Many thanks
kishk91
kishk91@hotmail.com
http://www.path.co.il
ICQ: 13610258
-
March 13th, 2000, 05:14 AM
#2
Re: How exactly do i use OnNcPaint() ???
At end of Your cide You calls base class OnNcPaint which draw standard frame over Yours bitmap. Try remove this call!
But! If You remive this You must draw ALL frame not only Bitmap.
To avoid this try call CWnd::OnNcPaint() first before Your drawing code.
Excuse my for my English.
-
March 25th, 2013, 07:39 AM
#3
Re: How exactly do i use OnNcPaint() ???
Originally Posted by ;217269
At end of Your cide You calls base class OnNcPaint which draw standard frame over Yours bitmap. Try remove this call!
But! If You remive this You must draw ALL frame not only Bitmap.
To avoid this try call CWnd::OnNcPaint() first before Your drawing code.
Excuse my for my English.
It works good in windows 7 and earlier versions but it is not happening in windows 8 operating system. Any suggestion.
-
March 13th, 2000, 05:35 AM
#4
Re: How exactly do i use OnNcPaint() ???
-
March 13th, 2000, 06:42 AM
#5
Re: How exactly do i use OnNcPaint() ???
Hi again...
i still have some problems / questions..
Let say that i have a bitmap 200 pixelx width and 10 pixels height.
when i draw that frae witht the OnNcPaint and then handleing OnEraseBkgnd and draw my own background then the bkgnd bimp biting from the frame..
how can i handle it??
when drawn the background im getting the Client rect and drawing the bitmap inside the client rect, from this problem i understand that my frame's bitmap it takeing some of the client rect...
any suggestions??
many thanks
kishk
kishk91@hotmail.com
http://www.path.co.il
ICQ: 13610258
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|