• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

Irregular shaped window

Hi,
    I am new to MFC programming. I want to know how to make an irregular shaped window based on a bitmap which is on a file.
Thanks in advance
Tranger
 
0
Tranger
Asked:
Tranger
1 Solution
 
AxterCommented:
0
 
BogdyPtrCommented:
Well you load the bitmap, you draw it on the dc of the window then you parse the dc and for any point of the transparent color you create a window region. You add   these regions into a destination region then you substract this destination region form the window region and set the resulting region as the new window region. That should do it.

For more help look at the followin functions in MSDN or other MFC documentation:

LoadImage                           //win32 API
CDC::DrawState                      //MFC
CDC::GetPixel                       //MFC
CWnd::Get/SetWindowRgn              //MFC
CombineRgn                          //win32 API
CreateRectRgn                       //win32 API
0
 
Roshan DavisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: Axter

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now