GDI related
-
Hi !! I want to convert text file into image file (jpg or tiff or gif) and save it. Can anyone tell me how ??? Thanks in advance.
-
Hi !! I want to convert text file into image file (jpg or tiff or gif) and save it. Can anyone tell me how ??? Thanks in advance.
You need to draw it yourself. Create a bitmap, and then draw the text on it. If you want to save in something other than bmp you need something like CXImage, GDI+ or Paintlib. I have lots of GDI+ articles on CP, and CXImage also lives here. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
-
Hi !! I want to convert text file into image file (jpg or tiff or gif) and save it. Can anyone tell me how ??? Thanks in advance.
You will need to load it into memory, then render it to a bitmap. You can do that by creating a bitmap and a memory device context then render the text with the DrawText API. After that you can save it out. There is no default mechanism to save JPG or GIF files in the Win32 API so you will need to use the LibJPEG or some other libraries in order to save your image. Good Luck
Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!