Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Draw lines and points in files?
Message
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
00779216
Message ID:
00779232
Views:
10
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 file
http://www.news2news.com/vfp/?example=187&function=53

Storing clipboard content to a BMP file
http://www.news2news.com/vfp/?example=189

Subclassing CommandButton control
http://www.news2news.com/vfp/?example=392

The 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.
Previous
Reply
Map
View

Click here to load this message in the networking platform