Question

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

Asked by: KELS

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.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-08-15 at 00:41:52ID20710410
Tags

image

Topic

FoxPro Database

Participating Experts
3
Points
500
Comments
25

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. about savepicture
    Hi Experts, My question is sill not be answered (hard?) and I am editing it to make it more clear. What I did is: 1. Using BitBlt function copied the whole screen of 256 colors to a picture box picture1. 2. Have checked the picture in picture1 by my eye and found that was p...
  2. cropping a graphic
    hello... i'm doing programming in vb 5.0 and i'm looking for a way to code a program that allows the user to select a particular section of a wmf or bmp file and then crop the rest of the graphic outside the select box. or the user could click an x1 and a y2 position using ...
  3. savepicture palette
    How can I maitain or set the picture palette when saving using savepicture statement?
  4. SavePicture(): Can I Force Output to 256 Colors?
    I'm executing the SavePicture() statement on a PictureBox control in an attempt to save the image in it (accessed via its .Image property) to a file: Example: SavePicture Picture1.Image, "C:\TEST1.BMP" However, the resulting .BMP file is unfortunately saved a...
  5. Convert Icons Into BMP?
    I am looking for a way to convert the graphic portion of an icon to .bmp with vb code.Thanks for any help :) Magoo

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: cbasozPosted on 2003-08-15 at 01:05:41ID: 9154791

Download GDI+ class from universalthread.com

 

by: suhashegdePosted on 2003-08-15 at 08:59:24ID: 9160222

posted to follow the thread

 

by: KELSPosted on 2003-08-15 at 11:11:40ID: 9161572

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'...

 

by: CarlWarnerPosted on 2003-08-15 at 11:18:48ID: 9161623

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?

 

by: KELSPosted on 2003-08-15 at 12:15:51ID: 9162000

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"?

 

by: CarlWarnerPosted on 2003-08-15 at 12:46:19ID: 9162229

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

 

by: CarlWarnerPosted on 2003-08-15 at 12:48:15ID: 9162253

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.

 

by: CarlWarnerPosted on 2003-08-15 at 13:49:55ID: 9162668

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

 

by: KELSPosted on 2003-08-15 at 15:07:44ID: 9163187

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?

 

by: CarlWarnerPosted on 2003-08-15 at 15:09:39ID: 9163199

I can try and install it on my only VFP5 PC.

Do you have the latest VFP5?  5.0a?

 

by: KELSPosted on 2003-08-15 at 15:53:31ID: 9163418

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...

 

by: CarlWarnerPosted on 2003-08-15 at 15:57:32ID: 9163433

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.

 

by: CarlWarnerPosted on 2003-08-15 at 16:15:31ID: 9163508

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.

 

by: KELSPosted on 2003-08-15 at 17:21:26ID: 9163727

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

 

by: CarlWarnerPosted on 2003-08-15 at 17:26:59ID: 9163739

I may just try it with VFP6 and see if that's the issue.

 

by: CarlWarnerPosted on 2003-08-15 at 17:37:02ID: 9163768

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.

 

by: CarlWarnerPosted on 2003-08-15 at 19:11:00ID: 9164031

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.

 

by: CarlWarnerPosted on 2003-08-15 at 19:48:14ID: 9164107

I can't get it to work.  In VFP6, it says the OCX may be corrupt or damaged.  Just great, huh?

 

by: CarlWarnerPosted on 2003-08-15 at 20:59:22ID: 9164351

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.


 

by: CarlWarnerPosted on 2003-08-15 at 22:10:55ID: 9164542

Here's the speedy response I got from the Viscom Software Support Team on our/your problem:

I checked the setup disk, the problem is our company release imageviewer version 2.3, our have not modify the sample code. the setup already register the ocx.

You can solve the problem as following

 download setup disk again http://www.viscomsoft.com/imageviewer.htm

OR

open the form, Select Tools-Options
Select Controls -Activex controls -ImageViewerCP 2.3
drop the control into the form and rename the name property to imageviewer

 

by: KELSPosted on 2003-08-15 at 22:57:58ID: 9164635

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.

 

by: CarlWarnerPosted on 2003-08-16 at 07:48:59ID: 9165618

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.

 

by: KELSPosted on 2003-08-16 at 09:21:23ID: 9165889

Thanks, would be very appreciative...

 

by: CarlWarnerPosted on 2003-08-16 at 09:26:05ID: 9165901

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.

 

by: CarlWarnerPosted on 2003-08-16 at 09:33:28ID: 9165919

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.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...