Click here to Skip to main content
11,802,636 members (70,898 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# Forms
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 15-Oct-12 13:13pm
Edited 16-Oct-12 0:29am
Matt T Heffron at 15-Oct-12 19:22pm
Nowhere NEAR enough information to start:
WinForms or WPF?
Image type: GIF, PNG, JPEG, TIFF, ...?
Curtdawg123 at 15-Oct-12 19:24pm
winForm and the image type is .bmp
Sergey Alexandrovich Kryukov at 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.
knvsatyanarayana at 16-Oct-12 2:46am
Can u explain the Question clearly and what do you require
Curtdawg123 at 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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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]
Curtdawg123 at 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)

  Print Answers RSS
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 Afzaal Ahmad Zeeshan 230
4 CPallini 230
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,695
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 16 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100