INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Tips -N- Tricks

How can I enhance my image? by ChrisRChamberlain
Posted: 7 Sep 00

If you want to emulate some of the functionality of the Kodak Image Edit control such as zooming and scrolling, here's a simple way using native FoxPro controls.

Select a form containing a FoxPro image control, note its .Left and .Top positions, right click on the control and select Cut.

Add a new form and Paste the image control into the new form at .Left = 0, .Top = 0.

The NON DEFAULT properties of the new form should be:-

WITH THISFORM
    .AlwaysOnTop = .T.
    .BorderStyle = 0
    .ScrollBars = 3
    .TitleBar = 0
    .Left = && Image control .left in original form
    .Top = && Image control .top in original form
    .Height = && Image control .height
    .Width = && Image control .width
ENDIF

In the load event put:-

THIS.Width = && Image control width
*--You will find the form will progressively reduce otherwise.

Save the form.

In the original form's Load event put:-

DO FORM newform NAME oGraphic NOSHOW

Add a spinner control, .spnZoom, with .KeyboardLowValue and .SpinnerLowValue = 100.

In the .spnZoom.InterActiveChange event put:-

WITH oGraphic.imgGraphic
    .Height = INT(oGraphic.Height * THIS.Value) / 100
    .Width = INT(oGraphic.Width * THIS.Value) / 100
ENDWITH

In the .spnZoom.MouseMove event put:-

oGraphic.Refresh()

In THISFORM.Activate put:-

WITH oGraphic
    .imgGraphic.Picture = && Filename
    .Show()
ENDWITH

You will probably need to use a Timer to ensure oGraphic does not appear before the form instantiates, to adjust the final position of oGraphic, and ensure oGraphic is released in the Form's Destroy event

You now have, (or appear to have), a zoomable, scrollable Image control.




Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close