CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 1999
    Location
    Sweden
    Posts
    33

    Sending pictures across network

    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


  2. #2
    Join Date
    Aug 1999
    Location
    India-Delhi
    Posts
    106

    Re: Sending pictures across network

    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

  3. #3
    Join Date
    Oct 1999
    Location
    Sweden
    Posts
    33

    Re: Sending pictures across network

    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?


  4. #4
    Join Date
    Aug 1999
    Location
    India-Delhi
    Posts
    106

    Re: Sending pictures across network

    You can make picture box NOT visible. When ever you wish to load it set

    picture1.visible = true




    Ok...
    This will help.



    Santulan

  5. #5
    Join Date
    Oct 1999
    Location
    Sweden
    Posts
    33

    Re: Sending pictures across network

    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


  6. #6
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Sending pictures across network

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured