Click here to Skip to main content
13,044,428 members (115,002 online)
Rate this:
Please Sign up or sign in to 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 15-Oct-12 13:13pm
Updated 16-Oct-12 0:29am
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.
knvsatyanarayana 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

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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 16 Oct 2012
Copyright © CodeProject, 1999-2017
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