Contents:

 

 

Introduction


News blog


What is Servoy?


Getting Started


Comparison Servoy/VFP


Performance


How-To's

 

Code Reference

 

VFP2Servoy Toolkit

 

 

Contact / feedback

 

 

 

 

 

 

 

 

 

 

 

 

 

 

How to add an image to a form



Adding an image from a file

 

As with many features in Servoy, working with images is similar to how VFP deals with them but also slightly different.

 

To work with images that are not part of a database but should be part of the solution they have to be added to the Media node in the Solution Explorer.

 

If you want to use an image on your form that is not databound then take the following steps:

 

  • Right-click the Media node in the Solution Explorer
  • Select the Import media option
  • From the dialog select the image you want to import (the file will be added to the List View window in the lower left corner)
  • Click the image icon on the toolbar

 

 

The image is added to your form where you can resize it and position it as you desire. You can also anchor it to the form to allow resizing.

 

 

 

Databound image field

 

The employee table of the example_data database contains an image field to which an employee photo can be added. How hard is it to create a data-entry form that allows the user to upload or paste a photo and how much code is involved? Let's try it out:

 

  • Create a form that is based on the employee table of the example_data database
  • When selecting the fields from the data provider dialog also select the photo field
  • Resize the photo field so it can contain a photo
  • Run the form as a smart client
  • Right click the photo control and try the options from the popup-menu
  • Run the form as a web client

 

smart client

 

web client

 

 

Conclusion

If you have ever experimented with storing binary data in your database you will certainly appreciate this functionality which requires no code at all (from us that is)! And it works on all platforms with all databases, that is sick!

 

 

External resources:

 

vfp plugin

 

ServoyWorld 2012 pics

 

Official Servoy website

 

Ken Levy on Servoy

 

Servoy info

 

Servoy Forum

 

Servoy Documentation

 

VisualFoxpro.com © 2010-2012 • All rights reserved • Contact: info@visualfoxpro.com