drawing text on an image
-
Hello folks, I wish to write text on an Image in .NET I figure I can use the Graphics.drawString() method to do so, but it turns out that .NET would only allow me to write on images with non-indexed pixel formats. The format I'm now using is 1bppIndexed, which allows me to keep the size of these image objects limited. I do not wish to change these images to a non-indexed pixel format like 24bppRGB (even though that allows me to draw text on the image), 'cause here I'm only dealing with binary images, each around 3500pixels by 2480pixels. Since a format like 24bppRGB occupies much more space than what is required, I was hoping there would be a way to write on the 1bppIndexed images directly. Any ideas? Thanks...
-
Hello folks, I wish to write text on an Image in .NET I figure I can use the Graphics.drawString() method to do so, but it turns out that .NET would only allow me to write on images with non-indexed pixel formats. The format I'm now using is 1bppIndexed, which allows me to keep the size of these image objects limited. I do not wish to change these images to a non-indexed pixel format like 24bppRGB (even though that allows me to draw text on the image), 'cause here I'm only dealing with binary images, each around 3500pixels by 2480pixels. Since a format like 24bppRGB occupies much more space than what is required, I was hoping there would be a way to write on the 1bppIndexed images directly. Any ideas? Thanks...
If you're using 1bpp images, that's plain black and white. Truetype fonts require more color depth to perform antialiasing, so that won't work. You can go three ways IMO: - render the font to a transparent image, convert to black & white and overlay over the original image, possibly creating a jagged font or - convert the image to more bpp, then render the text on top of it, then convert back to b&w. Will use a lot of memory for the converted image. or - use a bitmapped font that you can directly add to the image by using SetPixel() Good luck..
-
If you're using 1bpp images, that's plain black and white. Truetype fonts require more color depth to perform antialiasing, so that won't work. You can go three ways IMO: - render the font to a transparent image, convert to black & white and overlay over the original image, possibly creating a jagged font or - convert the image to more bpp, then render the text on top of it, then convert back to b&w. Will use a lot of memory for the converted image. or - use a bitmapped font that you can directly add to the image by using SetPixel() Good luck..
-
If you're using 1bpp images, that's plain black and white. Truetype fonts require more color depth to perform antialiasing, so that won't work. You can go three ways IMO: - render the font to a transparent image, convert to black & white and overlay over the original image, possibly creating a jagged font or - convert the image to more bpp, then render the text on top of it, then convert back to b&w. Will use a lot of memory for the converted image. or - use a bitmapped font that you can directly add to the image by using SetPixel() Good luck..