If not an ActiveX control or an external library, then Win API functions can provide this functionality, though it's not an easy job:
- use
CreateCompatibleDC,
CreateCompatibleBitmap to create a virtual space for drawing; you can use a form or main VFP window as a canvas too
- use numerous Windows API graphics functions (GDI) to draw lines, points, shapes, print text etc. with different pens, brushes, fonts on this canvas
- save result to a bitmap file with Windwos API functions
GetDIBits, CreateFile, CloseHandle* * *
I would recommend several examples (members area) on my VFP site:
Storing screen shot of a form to a BMP filehttp://www.news2news.com/vfp/?example=187&function=53Storing clipboard content to a BMP filehttp://www.news2news.com/vfp/?example=189Subclassing CommandButton controlhttp://www.news2news.com/vfp/?example=392The last one probably contains all functionality you need. The
TButton class draws button caption using different fonts and backgrounds on a virtual device context, saves the result in a temporary bitmap file, and then uses this file's name to populate the
Picture property for its CommandButton superclass.