Click here to Skip to main content
16,006,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionsimple question Pin
cyn83-Dec-06 19:17
cyn83-Dec-06 19:17 
AnswerRe: simple question Pin
ThatsAlok3-Dec-06 19:37
ThatsAlok3-Dec-06 19:37 
GeneralRe: simple question Pin
cyn83-Dec-06 21:30
cyn83-Dec-06 21:30 
AnswerRe: simple question Pin
flyalone3-Dec-06 20:52
flyalone3-Dec-06 20:52 
GeneralRe: simple question Pin
cyn83-Dec-06 21:31
cyn83-Dec-06 21:31 
AnswerRe: simple question Pin
Christian Graus3-Dec-06 22:52
protectorChristian Graus3-Dec-06 22:52 
AnswerRe: simple question Pin
David Crow4-Dec-06 4:59
David Crow4-Dec-06 4:59 
QuestionProviding a boundary to a RoundRect Pin
Ratish Philip3-Dec-06 18:13
Ratish Philip3-Dec-06 18:13 
I have overridden the OnPaint() API in a dialog based application to give the dialog box a rounded rect shape using CRgn.

<br />
CRect rect;<br />
GetClientRect(&rect);<br />
CRgn rgn;<br />
<br />
rgn.CreateRoundRectRgn(0, 0, rect.Width(), rect.Height(), 30, 30);<br />
<br />
SetWindowRgn((HRGN)rgn.GetSafeWnd(), TRUE);<br />


After that I have painted the inside of the Rgn giving it a gradient background as explained in one of the articles by Mr. Nishant.(using bitblt())

Now I want to draw a boundary to this rounded rectangle.
I tried FrameRgn() API but the gradient painting drew over the boundary.
I also tried FrameRect() API after gradient painting, selecting the NULL_BRUSH. But all I got was a black Rounded Rectangle.

How do I draw a boundary to the Rounded Rectangle without sacrificing my gradient background?


Cutebug Wink | ;-)

AnswerRe: Providing a boundary to a RoundRect Pin
Naveen3-Dec-06 19:10
Naveen3-Dec-06 19:10 
GeneralRe: Providing a boundary to a RoundRect Pin
Ratish Philip3-Dec-06 19:26
Ratish Philip3-Dec-06 19:26 
GeneralRe: Providing a boundary to a RoundRect Pin
Naveen3-Dec-06 19:31
Naveen3-Dec-06 19:31 
GeneralRe: Providing a boundary to a RoundRect Pin
Ratish Philip3-Dec-06 19:50
Ratish Philip3-Dec-06 19:50 
GeneralRe: Providing a boundary to a RoundRect Pin
Naveen3-Dec-06 19:54
Naveen3-Dec-06 19:54 
GeneralRe: Providing a boundary to a RoundRect Pin
Mark Salsbery3-Dec-06 19:33
Mark Salsbery3-Dec-06 19:33 
GeneralRe: Providing a boundary to a RoundRect Pin
Naveen3-Dec-06 19:53
Naveen3-Dec-06 19:53 
GeneralRe: Providing a boundary to a RoundRect Pin
Ratish Philip3-Dec-06 20:47
Ratish Philip3-Dec-06 20:47 
GeneralRe: Providing a boundary to a RoundRect Pin
Mark Salsbery4-Dec-06 6:16
Mark Salsbery4-Dec-06 6:16 
GeneralRe: Providing a boundary to a RoundRect Pin
Ratish Philip4-Dec-06 15:45
Ratish Philip4-Dec-06 15:45 
GeneralRe: Providing a boundary to a RoundRect Pin
Super Hornet4-Dec-06 16:58
Super Hornet4-Dec-06 16:58 
Questionhow to add support of multilingual to application Pin
kiranin3-Dec-06 18:12
kiranin3-Dec-06 18:12 
AnswerRe: how to add support of multilingual to application Pin
ThatsAlok3-Dec-06 19:44
ThatsAlok3-Dec-06 19:44 
QuestionCComboBox Question Pin
CoffeeAddict193-Dec-06 17:54
CoffeeAddict193-Dec-06 17:54 
AnswerRe: CComboBox Question Pin
Mark Salsbery3-Dec-06 17:58
Mark Salsbery3-Dec-06 17:58 
QuestionYashwant Kanetkar's e-courses at http://quest.ksetindia.com Pin
avanish1233-Dec-06 17:48
avanish1233-Dec-06 17:48 
AnswerRe: Yashwant Kanetkar's e-courses at http://quest.ksetindia.com Pin
Mark Salsbery3-Dec-06 18:03
Mark Salsbery3-Dec-06 18:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.