Click here to Skip to main content
15,885,883 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I'm trying to put a check-mark bitmap(.bmp) over a background in a win form, but as the check-mark's is not a rectangle the white trim gets in the way of the background. I don't want that to happen is there any way I can eliminate that trim just with code. Maybe I could set the color white to transparent but I don't know how to do that, or even if it's possible. Maybe someone out there knows.
Posted
Updated 16-Oct-12 0:29am
v3
Comments
Matt T Heffron 15-Oct-12 19:22pm    
Nowhere NEAR enough information to start:
WinForms or WPF?
Image type: GIF, PNG, JPEG, TIFF, ...?
Curtdawg123 15-Oct-12 19:24pm    
winForm and the image type is .bmp
Sergey Alexandrovich Kryukov 15-Oct-12 21:29pm    
Add the tag: Forms. You are the one who is most interested in it, to avoid confusion. And please explain the problem in sufficient detail.
--SA
Naga KOTA 16-Oct-12 2:46am    
Can u explain the Question clearly and what do you require
Curtdawg123 16-Oct-12 6:28am    
Sorry, I'm pretty new to this but I just improved the question. Maybe it will be a bit clearer.

1 solution

BMP images are bitmaps, and do not contain any transparency information. Try using a PNG file instead (you favourite image editing program will tell you how to do transparent backgrounds).

If you must use a bitmap, then you will have to draw the check mark yourself, and define a region of the bitmap which will be drawn - this is complex if the check mark is not just comprised of two strokes at an angle, and will probably not look too good as the edges will be very sharply defined, rather than smooth and aliased.

I use PNG files for nearly all my small images - the transparency is just one of the advantages over bitmaps!

[edit]Typo - "type" for "try" - OriginalGriff[/edit]
 
Share this answer
 
v2
Comments
Curtdawg123 16-Oct-12 6:50am    
Okay, I'll use a PNG.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900