Loading ...
Sorry, an error occurred while loading the content.

How do I retreive a picture from an URL

Expand Messages
  • tb@tcltalk.ath.cx
    Hi, i ve loaded the webBrowser and its stuff and I wonder how to use it to return a ui2image from http://www.cs.ucsb.edu/~urs/oocsb/self/release/smalltalk.gif
    Message 1 of 4 , Mar 2, 2011
    • 0 Attachment
      Hi,
      i've loaded the webBrowser and its stuff and I wonder how to use it to
      return a ui2image from

      http://www.cs.ucsb.edu/~urs/oocsb/self/release/smalltalk.gif

      I found parseGIF in "webBrowser htmParser", but it works on a sibling
      slot instead taking an URL as an argument.

      Any suggestions, how to decompose this?

      Many thanks in advance...
      Thomas
    • Chris Double
      ... Have a look at the slots of the object returned by: http://www.cs.ucsb.edu/~urs/oocsb/self/release/smalltalk.gif asUrl If you have a webpage you can
      Message 2 of 4 , Mar 2, 2011
      • 0 Attachment
        On Wed, Mar 2, 2011 at 10:24 PM, <tb@...> wrote:
        > I found parseGIF in "webBrowser htmParser", but it works on a sibling
        > slot instead taking an URL as an argument.
        >
        > Any suggestions, how to decompose this?

        Have a look at the slots of the object returned by:

        'http://www.cs.ucsb.edu/~urs/oocsb/self/release/smalltalk.gif' asUrl

        If you have a webpage you can display it for example with:

        'http://www.bluishcoder.co.nz/self/imagetest.html' asURL getPageForUser

        I have a screencast here going through some of this:

        http://www.bluishcoder.co.nz/2009/07/27/displaying-images-with-self.html

        Chris.
        --
        http://www.bluishcoder.co.nz
      • tb@tcltalk.ath.cx
        ... asURL | webBrowser htmlParser parse: url getContentsString From: url. but that gives me a webBrowser instead of a ui2image :) Thomas
        Message 3 of 4 , Mar 2, 2011
        • 0 Attachment
          tb@... schrieb:

          > I found parseGIF in "webBrowser htmParser", but it works on a sibling
          > slot instead taking an URL as an argument.
          >
          I also connected some pieces like:

          | url = 'http://www.cs.ucsb.edu/~urs/oocsb/self/release/smalltalk,gif'
          asURL |
          webBrowser htmlParser
          parse: url getContentsString
          From: url.

          but that gives me a webBrowser instead of a ui2image :)

          Thomas
        • tb@tcltalk.ath.cx
          Chris Double schrieb: ... Thanx a lot. I think I hacked it. ;) [code] ... (webBrowser webImageMorph copy sourceURL: uri asURL) buildImage. [/code] Getting the
          Message 4 of 4 , Mar 2, 2011
          • 0 Attachment
            Chris Double schrieb:
            ...

            >
            > I have a screencast here going through some of this:
            >
            > http://www.bluishcoder.co.nz/2009/07/27/displaying-images-with-self.html
            >
            Thanx a lot.

            I think I hacked it. ;)

            [code]

            | uri = 'http://www.cs.ucsb.edu/~urs/oocsb/self/release/smalltalk,gif' |

            (webBrowser webImageMorph copy sourceURL: uri asURL)
            buildImage.

            [/code]

            Getting the above outliner and using it's 'Show morph' menu option shows
            the smalltalk.gif web image on screen. :) - How do I script it to show
            up on screen?

            BTW: What would be the best way for resizing a ui2Image? Should I invoke
            'convert' from ImageMagick? Though, it wouldn't be portable that way.

            Thomas
          Your message has been successfully submitted and would be delivered to recipients shortly.