Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to place a circle/dot on a image in image control and then save as new picture with changes 2

Status
Not open for further replies.

vj

Programmer
Nov 18, 2000
58
MU
hello everyone,

i have a form with a image control which is displaying a somemap.jpg ,, now i want to be able to take my mouse anywhere over the image and when i click on it a small dot or circle should be placed .. and i have a button when clicked should save that somemap.jpg with the changes as a new image file. is it possible to do it in visual foxpro with it's native image control ... maybe i could have some code sample or something ?
iam using LOADPICTURE() to load the map-picture file into the image control and SAVEPICTURE() to save the same image file as a different file with different name ... but i just want to know how to be able to place a dot or circle on that image so i can save the new file with the changes.

thankx alot
vijay
 
Hi,
In the case you would like to save your image with a new image (cirkle or dot or wahteve) saved as a new image your best option is to make use of GDIPlus to be found on the VFPX website. Meanwhile there is a new version GDIPlus1.21 Beta available. There are lots of samples including a sample how to merge two images. Look for 'Play with logo'
Jockey(2)
 
Read the help topic about LOADPICTURE. It says you can use the PictureVal property of the VFP image control to display that loaded picture, but that's about what you can do in the Image control. The Image control itself has no way to change an image, it's just a display control. The main intention of the LOADPICTURE function is to load pictures for ActiveX controls. If they allow modifications, interactive or programmatic, SAVEPICTURE can then save that picture.

You can draw anywhere on the form canvas with GDI+, as Jockey mentions, this is surely the best way to get this done. The gdiplusx library for VFP makes all API declarations of the gdiplus dll and more, you'll also find sample code, not only at the codeplex home of this project, more precise it's at
Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top