Results 1 to 7 of 7

Thread: [RESOLVED] Silverlight External Image

  1. #1

    Thread Starter
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Resolved [RESOLVED] Silverlight External Image

    I'm trying to dynamically load an image into an Image control using code. As long as the image resides within the Silverlight solution, all is well. However, when the image resides outside the solution I get an AG_E_NETWORK_ERROR error.

    Note: the image I'm trying to load resides in a UNC share (\\server\share\image1.jpg) and not on another web server.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  2. #2
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    448

    Re: Silverlight External Image

    Just a question but did you try adding it through the image popup box for an image control. What I mean by that is did you try and get it to show up by adding an image control then click the ... button and browse for the image through the share. The reason I ask this is because it may not be available. However, if it does work like that take a look at the code that it created to do it and just duplicate it in code.
    If I helped you please rate me.

  3. #3

    Thread Starter
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Silverlight External Image

    Doesn't work that way. If you browse for the image, it adds it to the project resources and you refer to it directly. Otherwise, I can add an external absolute http reference easily. It's the local network, UNC reference I can't figure out.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  4. #4
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    448

    Re: Silverlight External Image

    oh yeah i forgot about it loading it as a reference lol (long day). Have you tried connecting to is using the ip address? if you dont know it you can ping the machine.
    If I helped you please rate me.

  5. #5

    Thread Starter
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Silverlight External Image

    I know the machine and its IP address, that's not the problem. What I can't see how to achieve is dynamically bound the source of an image to an existing image shared in the network.

    For example, with HTML you'd use an IMG tag with something like this:
    Code:
    <IMG src="file://server/share/image1.png">
    Can you do the same with Silverlight dynamically?
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  6. #6
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    448

    Re: Silverlight External Image

    This is a quote from the silverlight forums:

    Silverlight doesn't allow arbitrary access to the file system or shares.
    If you are running a website on the server I would suggest just putting the file somewhere you can access it from the server and then point it to that location in your silverlight app.
    If I helped you please rate me.

  7. #7

    Thread Starter
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Silverlight External Image

    Super.

    It's small things like that that turn me down. I'm willing to bet that the workaround would be to communicate between Silverlight and Javascript and have a client-side js dynamically load the image into a frame. Another level of indirection and (again) Javascript proves to be king of the hill.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

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