Link to home
Start Free TrialLog in
Avatar of Daed
Daed

asked on

Draw a Transparent Icon

How can I draw a transparent Icon without using DrawIcon function. I don’t want to use DrawIcon because it didn’t limit the width and height of the Icon in the DC. So I need a method that can draw a transparent icon within certain width and height.
Avatar of Roshan Davis
Roshan Davis
Flag of United States of America image

Use function DrawIndirect of CImageList

Good Luck
Avatar of Daed
Daed

ASKER

DrawIndirect does not clip the icon, it draws it according to the width and height values passed in the parameter, so if I passed a smaller height the icon will be shrank to fit this height. What I need is to clip the icon according to the height and width I need.
ASKER CERTIFIED SOLUTION
Avatar of fl0yd
fl0yd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Daed

ASKER

I am trying GetDCEx function, it is not working with me, I am not sure if I am using the correct flag. Can you help me in this?
Since I never really used this, I will have to guess just as much as you do. I would recommend specifying the DCX_INTERSECTRGN flag at any rate. If someone has experience with GetDCEx, please respond to this thread.

.f