[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

Need to make part of a bitmap transparent

Hi,

I need a circle surrounded by transparent color, so that I can place the dot on a MapPoint map and have only the dot show up.  How do I specify that the perimeter of the circle should be transparent?

Thanks,
Bob
0
ba272
Asked:
ba272
  • 3
  • 2
  • 2
2 Solutions
 
ba272Author Commented:
I would like to modify the image pixel by pixel.  I would also learn in the process how to modify the color choice for the pixels which I did not explictly set to be transparent.
0
 
bruintjeCommented:
Hi ba272,

no idea if you can use transparant colors in the bitmap editor in VS 2003, but here is a samll free editor that does
http://ranfo.com/iconedit.html

for a small howto
http://ranfo.com/iconedit-tips.html

hope this helps a bit
bruintje
0
 
vo1dCommented:
do you wanna change the pixelcolor by code?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ba272Author Commented:
Yes, for now I need to make a red dot to overlay on a MapPoint map, and therefore need to make the corners transparent so that the image will not appear as a square.  But I also need to programatically change the colors, pixel by pixel by code.  I anticipate having 5000 images, each needing to have the corners made transparent, and needing one of 50 colors to be assigned to known locations on the bitmap.





0
 
vo1dCommented:
you have to load your images in a bitmap object and then you could change a pixel of it with the color of your choice.
example:

Bitmap bmp = new Bitmap(1, 1);
bmp.SetPixel(0, 0, Color.Gray);

if you have large images, i would not recommend using the setpixel method, because there are faster ways of manipulate images.

0
 
vo1dCommented:
here is an example which fits to your needs i think.
and it uses the much faster approach in using lockbits methods.
http://www.c-sharpcorner.com/Code/2003/March/ThumbnailImages.asp
0
 
bruintjeCommented:
thanks that was not necessary i thought you wanted to do it manually in a follow up on your earlier question vo1d had a good answer doing it in code :)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now