Writing text on given bitmap file
-
If it's a bmp, LoadImage will load it. Otherwise, GDI+ will probably load it. Then you need to select it into a DC, draw text on it and save it again ( which probably means you need GDI+ and will load it into a Graphics object ). I have several articles on gDI+ here, one of them is called 'doodle' - it will show you how to load and save an image, and draw on it. Just change the code to draw text instead. Christian Graus - Microsoft MVP - C++
-
If it's a bmp, LoadImage will load it. Otherwise, GDI+ will probably load it. Then you need to select it into a DC, draw text on it and save it again ( which probably means you need GDI+ and will load it into a Graphics object ). I have several articles on gDI+ here, one of them is called 'doodle' - it will show you how to load and save an image, and draw on it. Just change the code to draw text instead. Christian Graus - Microsoft MVP - C++
-
I cant find the the article... would u mind giving me the link? Its a bmp but not not necessarily in the resource folder...
I don't see how you could miss it. I typed 'doodle' in to the search and it was the first hit. You could also click on my name and 'view articles'. http://www.codeproject.com/vcpp/gdiplus/doodle.asp[^] The bmp would have to be on disc, not a resource. Christian Graus - Microsoft MVP - C++
-
CImage m_Image; m_Image.Load("d:\\picture.bmp"); in the function OnPaint(event WM_PAINT) CPaintDC dc(this); // device context for painting BitBlt(dc.m_hDC,0,0,800,600,hdc,0,0,SRCCOPY); dc.TextOut(40,40,"test",5);