Last active
June 25, 2019 20:20
-
-
Save zett42/56c89105bca6848cc9622ca6a452cb80 to your computer and use it in GitHub Desktop.
CStatic transparent color 0xF0F0F0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In OnInitDialog() | |
CRect rc; GetClientRect( rc ); | |
CDC* winDC = GetDC(); | |
CDC memDC; memDC.CreateCompatibleDC( winDC ); | |
int const savedDC = memDC.SaveDC(); | |
m_bitmap.CreateCompatibleBitmap( winDC, rc.Width(), rc.Height() ); | |
memDC.SelectObject( m_bitmap ); | |
memDC.FillSolidRect( rc, RGB( 255, 220, 128 ) ); | |
rc.DeflateRect( 50, 50 ); | |
CBrush brush; brush.CreateSolidBrush( 0xF0F0F0 ); | |
memDC.SelectObject( brush ); | |
memDC.Ellipse( rc ); | |
memDC.RestoreDC( savedDC ); | |
memDC.DeleteDC(); | |
ReleaseDC( winDC ); | |
// This is a CStatic member of the dialog | |
m_pictureCtrl.SetBitmap( m_bitmap ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment