Link to home
Start Free TrialLog in
Avatar of KELS
KELS

asked on

VFP5: How to open/display/edit/save a graphical image?

Hi --

I'm hoping to find a way, using vfp5.0, to open and display a .bmp image in a form; to edit the image (i.e., cut/crop/resize), then save the image to a file for printing on a report.

I see possibilities when reading documentation (LoadPicture, SavePicture, OCX's) but don't have enough documentation to put is all together.
Avatar of cbasoz
cbasoz

Download GDI+ class from universalthread.com
posted to follow the thread
Avatar of KELS

ASKER

I would like to make this work without using 3rd party software, only vfp and/or Microsoft OCX's.  Maybe something like opening up with Microsoft's 'Paint'...
Not having VFP5 handy, have you tried to use the supplied image control to show a picture and then double-clicking on that image to call the available OLE server that should allow editing of that image?
Avatar of KELS

ASKER

Yes, with limited success.

However, Carl, I may have found a suitable solution, prompted by one of your responses to a previously posted question.  I need to do some experimenting...

Is there some way to put this queston "on-hold"?
You can't put this on hold until I get the rest of my reply out there that could be of help.  ;)

I took a quick peek at an old PC here that I hooked back up that has VFP5 on it.  Each VFP version ships with a set of ActiveX controls of which there is an imaging one.

If you're placing an OLE Container Control on a form from the Form Controls toolbar, after clicking on the Form, in the subsequent Insert Object dialog that comes up, change from the default choice of "Create New" and select "Insert Control" instead.  Then scroll down in the very slowly populated list looking for the one named Microsoft ActiveX Image control (or any other you may see that looks like an image control or something you want to test).  

One potential problem is with the use of scroll bars:

PRB: Using Scroll Box on ActiveX Image Control Causes Image Distortion and Scrollbar Problems
http://support.microsoft.com/default.aspx?scid=kb;en-us;243255

It seems that using the Kodak control is more popular so there could very well be a Kodak Image Edit (Wang) control in that list.

This is a great article on handling images within VFP:

TEACH THE FOX HUNT PICTURES BETTER
http://www.foxite.com/articles/002.htm

I believe MS used to include it with the OS software, but now under WinXP that is no longer the case:

Kodak Imaging for Windows Is Not Included with Windows XP
http://support.microsoft.com/default.aspx?scid=kb;en-us;308979

You might, too, download the control that follows that is mentioned as part of a VFP6 example.  There isn't any good reason it wouldn't work under VFP5:

Visual FoxPro 6.0 Sample: Selects a Printer by Using the Kodak Image Admin Control
http://support.microsoft.com/default.aspx?scid=kb;en-us;261237

Another KB article utilizing the Kodak image control:

HOWTO: Print Multiple .tif Files from Visual FoxPro
http://support.microsoft.com/default.aspx?scid=kb;en-us;281380

Other image related articles for further reading:

THUMBNAILS, ANYONE? (part 1 of 2)
http://www.foxite.com/articles/010.htm

THUMBNAILS, ANYONE? (part 2 of 2)
http://www.foxite.com/articles/011.htm
That one MS KB article does not have a control download as I mistakenly said above.  It is a form, rather than the control, to show how to use the control.   I posted too quickly with that.
Also, there are two articles at VFUG ( http:/www.vfug.org/ ) in the Newsletters section on the Kodak control:

November 1998 Newsletter
Imaging ActiveX Controls
by Scott Hurlbert

June 2002 Newsletter
USING KodakImg CONTROLS IN VFP FORMS
by Elliott Myron
Avatar of KELS

ASKER

Carl, you have give me much to try.

In response to a 3/31 graphics-related post, you has mentioned "Image Viewer CP", which looked intriguing, so I downloaded the demo and ran setup.  But when I place an OLE Container Control on a form, an loaded it with the ImageViewer2.ocx, vfp blew up and exited.

I tried opening the downloaded vfp example form, and it informed me that the ocx was not registered.  So I registered it.  But once again, when I tried the above, vfp exited with "fatal error".

I must be missing a step. Can you give me any advice in regard to using the Image Viewer ocx?
I can try and install it on my only VFP5 PC.

Do you have the latest VFP5?  5.0a?
Avatar of KELS

ASKER

My version is 5.0a...

But hold for a moment, I'm trying the suggestions as outlined in the "TEACH THE FOX HUNT.."

This may work out...
OK.  I am just in the process of running the Setup program for the ImageViewer CP Demo to see whether it crashes my VFP.
Won't hurt to load it.  That's what uninstall is for.
I failed at getting ImageViewer CP Demo to work on that PC.  I think it's because, at least in my case, that the Windows version is only Windows 95 and the software's minimum requirement is Windows 98.  Regardless, it failed when I tried to open the form from the project and, after I manually installed the OCX (ImageViewer2.ocx), it still failed when I ran the compiled project exe.

I don't have VFP5 on anything that is newer than Win95.
Avatar of KELS

ASKER

I had the same experience, I'm running windows 2k...  

I may just try it with VFP6 and see if that's the issue.
I tried it with VFP6 on Win95 and it also failed.  I think it's safe to say that Win95 should be left behind.

I have VFP6 on a W2K box.  I'll try that, too.  If that doesn't work, I'll scrap ImageViewer forever.
Since it failed on the W2K box, I think the problem really lies with the three DLLs the control author wants us to use and they either don't get installed where you'd expect or they just aren't in the search path.  I'll try another approach.
I can't get it to work.  In VFP6, it says the OCX may be corrupt or damaged.  Just great, huh?
I don't get this control.  They actually say it works all the way back to the first version of VFP.

Q:  I have old VFP 3 application, Can I use it?
A: Yes.ImageViewer CP already fully testing in VFP 3.0, 5.0, 6.0 and 7.0.  

I guess I'll float them a question and ask them why it always says it's not registered whether I trust their install or I manually install it.  This makes no sense.


ASKER CERTIFIED SOLUTION
Avatar of CarlWarner
CarlWarner
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KELS

ASKER

Carl, thank you for all your help with this matter.  I found a way to do what I needed to do without resorting to 3rd party software.  

I've tried quite a number of 3rd party stuff over the last two years (I would love to find a good wav/mp3 ocx encoder/decoder) but have not yet encountered an ocx that actually worked -- except for Mabry which always works, but that's a group of professionals.

Again, thanks.
I toyed with an mp3 player oly only a few years back (1999-2000), and it worked just fine.  If I can dig it out, maybe the company has made it evolve since then to jump through flaming hoops.  I'll see.
Avatar of KELS

ASKER

Thanks, would be very appreciative...
The control was an OCX that worked in VFP3 that I was running on a Pentium 133 with 32Mb RAM.  We've come a long way since then (at least I have).  The control started with the letters BW and that's all I know for the moment until I dig further into this.  I'll let you know if I find something further.
It seems that BW was enough for me to remember to get Google to find it. ;)

BW is the initials for Binary Works.

http://www.binarywork.net/bwmp3old.htm

It seems that this one, from what I quickly read, is still a decoder only.