how do I receive a bitmap image into my program

squire91
squire91 used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
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

Author

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

Author

Commented:
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?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
Hi Squire.
I think for your purpose you should write the scanned image to a file first(maybe a temp file, which you can kill later) then find out how to bring it into your exe, via the picture box controls, putting the name of your temp file in, so each time you scan, the app will call the same file, but with a new picture.
let me know

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

Author

Commented:
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?

Author

Commented:
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?

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

Author

Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial