Click here to Skip to main content
Rate this: bad
good
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
v3
Comments
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.
--SA
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
good
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]
  Permalink  
v2
Comments
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 OriginalGriff 330
1 Maciej Los 180
2 Richard MacCutchan 115
3 arvind mepani 104
4 Tino Fourie 92


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