Search the Community
Showing results for tags 'bmp text'.
Found 1 result
I have seen this question asked (and ) before, but my needs are a little different so I am only 90% of the way. Hope someone can give the final puzzle piece. Here is what I need: * from a text file which is Unicode UTF8 (BOM), read strings one by one * create a BMP file of 300 px high and place textline on it - BMP must be 2 bit (b/w only) * save BMP * read next line In the end there is as many different BMPs as there are lines in text file. I know how to operate _GDI_GraphicsDrawstring, that part is simple. But what I can't find the answer to is 1) how to calculate the space needed horizontally by a given string in 300 px height 2) how to create a white-background BMP in memory, so it can be populated and written to disc. Point 2) is the most important, the auto-font-size-calculation can come later. For now it's trial and error. Referring to ImageMagick, this would be $image->ReadImage('canvas:white'); The purpose is to use images in an industrial microcontroller. Therefore the need for 2bit BMP and 300px exact in height. Thanks for any help