Link to home
Start Free TrialLog in
Avatar of squire91
squire91

asked on

how do I receive a bitmap image into my program

I have a visioneer scanner with a monitoring program that will send your scan to another program.  I would like to make my own program to handle the events.  The program is called "one touch monitor".  It has a wizard to create a link that specifies how to send the file.  the first thing asked is type (image, text etc), asks for the exe location, asks for formats (assume jpeg,bmp), and some naming options.  
What code/ controls on my project do I need to give my program to receive this object.  I was assuming I would make an ole control that accepts bitmaps, but don't know the code to allow the program to accept the image.
Avatar of Noddy_SA
Noddy_SA

I am not sure what the real problem is. But this is what I think.
You must use "OLE" to bring in and display the picture. However use "Image Control" to save memory and disk space."Picture Boxes" are memory hungry. So use Image where possible.
Bring an Image control on to a form, and and link your command buttons to the "stretch" control, and to the sizing.
Hope this helps
Noddy_SA
Avatar of squire91

ASKER

Right now just worried about getting it into the program.  I've made a basic form, put an ole control on it and linked the scanner program to it (with the wizard from the scanner program).  Didn't work.  Tried using the ole control as a paperport document, a bitmap, and also just placed a picture box and image control on.  I did this separately each time and recompiled the exe.  The scanner calls the program and seems to send the image, but nothing displays.  There has to be some code to write in my program to receive it and then put it into whatever control is on the form????  I was thinking a loop that watched for another program to send the ole and then when it does it specifies the picture??
Keep in mind i'm a bit of a newbie.  I've read a little about opening other programs with your own, but I need this one to wait for a program to send the image, receive it, then I can code the rest.
so if I use ole to bring it in do I just pick an ole control and place it on the box?  when I do this it asks to specify the document/file you want.  I've just hit cancel thinking my exe would pick up the document in the ole?
ASKER CERTIFIED SOLUTION
Avatar of Noddy_SA
Noddy_SA

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
OOOOPS Sorry there is one more thing, when you use the OLE editor you must turn the OLE editor off or the picture will not open or display.
I think I've convoluted my question.
I can already make a temp file with the software that came with the scanner, and I have a viewer with zoom, and file handling capabilities.  The problem is where the scan occurs the scanner program takes focus on the screen and it's a bit of an annoyance.
I guess my real question could be like this.
If I have a program that could open any image file on the hard drive and send it to another program, what controls & protocols would I use in the 2nd program to accept that image.  Does that make more sense?
Another thought I just had was to run a program that checked the directory of the scan for changes, set a timer that would wait a second and then minimize the receiving program.  would that be easier?
Now I have no idea of what you are trying to do or why. If you just need to view a picture file, use a graphics viewer, like IRFANVIEW. Its free and works on all formats, and even big files in seconds.
But why not just read from a file that is already in stack or on disk ???? why do you need all sorts of unnessary clutter?
 Let me know what the real problem is.

I ended up finding a "file exporter" program that would take the scanned image (in paperport file format) convert to jpeg and then save without taking focus away from the program the person is using (where the scanner is hooked up).  It autonames as well.  It would be nice to be able to name the files to  a specific format, but this fits my needs.  sorry about being so unclear, but I did use your suggestion

thanks