I work with bitmap images in pictureBoxes, and color some pixels. I wonder if it is possible to fill just half of pixel? If yes, how to perform it in C# ?
You can't set color of just half of a pixel in bitmap.
You may be looking for sub-pixel rendering where RGB colors of individual pixels on a LCD screen are adjusted separately or anti-aliasing where the color of pixels of single object essentially bleeds to nearby pixels to provide smoother edges.
i need convert to Black this image.
need to convert image totally dark for simulate a shadow.
"not black and white process. need totally dark"
example
before converte image totally black
how to stretch in horizzontal type this image?
I have a .png image, i want to get the points that the shape is made of.
Example:
I know that i won't get a perfect output but anything would be good..
How should I start?
I would need to get a list of points out of my image.
Very simple. Replace an NON white pixels by black. Then loop in each black pixel and turn them white if not adjacent to at least 1 white pixel.
I have 2 images, foreground and background. I want to combine the 2 using an alpha mask image such that black = use background pixel, white = use foreground pixel and grey is an alpha blended mix of the 2.
The foreground and background images are fixed, while the mask image is created on the fly and then moved as required to create an animation.
Is there any performant way to do this using the standard library? I can use LockBits and a loop but I'd like something faster, if such a thing exists.
I want to set an image to have a transparent background, but I do not want to replace all pixels of a specific colour with transparency.
To be more specific, the image is a thumbnail image for a folder, obtained via IShellItemImageFactory.GetImage. This gives me a Bitmap, as displayed in Windows Explorer thumbnail view, but the background is solid white.
I can use Bitmap.MakeTransparent on it, and that will work in most cases, but in any cases where the thumbnail image contains white itself (for example, a folder that contains images, which include white colours).
Incidently, this is the first time in over 10 years as a developer that, after googling my question, I have not found an answer anywhere, and I've actually had to ask it myself. (I think that means I just levelled up! Yippee, I am now a level 2 developer...)
Use flood-fill algorithm to fill pixels of the same color from the OUTSIDE as you need it. It is something similar to magic wand in photoshop.
http://en.wikipedia.org/wiki/Flood_fill
What I would do is flood-fill with some obscure color (Magenta always does it for me), then replace that color with transparent (I don't know if flood filling with transparent pixels is feasible).
So what you're getting from IShellItemImageFactory.GetImage is a composite image that contains the original image on a white background? I suspect the white background is there if the image doesn't have the same aspect ratio as the thumbnail size. For example, if you ask for a 96x96 thumbnail of a 640x480 image, there's going to be some white space at top and bottom.
If that's the case, you have a problem. You can't differentiate between white pixels that are contained in the image, and white pixels that are added by GetImage.
There are a few things you could do. You could load the image and resize it yourself. That's probably the easiest. You'd want to maintain your own thumbnail cache then.
Or you could examine the image returned by GetImage to look for white space on the sides. Basically, if every pixel on a row (or column) is white, then make that row (or column) transparent. It's a little more complicated than that (the NBA logo, for example). But that's essentially what you'd want to do.