Click to See Complete Forum and Search --> : Sending pictures across network


jen
December 16th, 1999, 08:42 AM
Hi!
I have an application on a client and I have some pictures on the server and I wonder how I can load them into application without showing them until I need them.
I really need a detailed description.
Thanks for your help!
Jen

santulan
December 16th, 1999, 09:40 AM
Hi,

There are several ways of doing so...
Just this may solve.
You can always give the network path to point to a picture... suppose your server name is LBS7 and subdirectory where pictures are available is pic. I assume that you have shared the directory and given proper authentication, etc.

There is LoadPicture function in vb.
When ever you wish to load a picture into a picture box say

picture1.picture = loadpicture("//lbs7/pic/thispic.jpg")
....
....



Picture will be loaded into the picture box.

I wish that solves your problem.


Santulan

jen
December 17th, 1999, 01:56 AM
Hi
Thanks for your replay.
If the picture is large and I have many there might be a delay in showing the pictures. I want to load them into the RAM and keep them there until it is time for them to be shown. How can I do that?

santulan
December 17th, 1999, 02:11 AM
You can make picture box NOT visible. When ever you wish to load it set

picture1.visible = true




Ok...
This will help.



Santulan

jen
December 17th, 1999, 03:51 AM
Hi again!
Thanks for taking time to help me.
I think that my question is not so clear.
I have several pictureboxes and they are all visible. But I have 3 times as many pictures and I alter which pictures that will be loaded into pictureboxes. I want to have *all* the pictures in RAM so when I change picture there will not be a waiting period.
Hope you can help me this.
thanks
Jen

Ravi Kiran
December 17th, 1999, 04:49 AM
Use the Picture Object. This is also less resource hungry than the picture box, image control

Typical code is

dim picElems(20) as Picture

for i = 0 to 20
set picElemts(i) = LoadPicture(networkpath)
next i



And when required,

set Picture1.Picture = picElems(someindex)

So i would go about like this:

Set up a timer, and on each timer strike, load a few pictures. First few (as many as visible in first go), i will show as and when read.
The the timer will still be ON.. and will read other picture data too.. till the last of them is read.. may be some status can be maitained.. and Cursor can be Arror+Hrglass, to show that something is still going on in the BG, but since it is a timer, user can still click and do something

Not pure multi-threading/background processing.. but something similar in effect

RK