none
How to insert a picture into a graphics window? RRS feed

  • Question

  • Can someone please tell me how to insert a picture (url) into a graphics window of the same size. Would be appreciated.
    Friday, November 25, 2011 9:29 PM

Answers

  • Hi,

    'Set a string variable to the URL
    imageURL = "http://ts3.mm.bing.net/images/thumbnail.aspx?q=1307362992378&id=e6c34a02c787e1d569801655eb6935e3&url=http%3a%2f%2fimages.sky-map.org%2fstar_image%2f000%2f000208.jpeg"
    'Download the image to a temp store
    imageStore = ImageList.LoadImage(imageURL)
    'Create a GraphicsWindow of a size you want
    gw = 800
    gh = 600
    GraphicsWindow.Width = gw
    GraphicsWindow.Height = gh
    'Load the image to the GraphicsWindow and scale it to the window size
    GraphicsWindow.DrawResizedImage(imageStore,0,0,gw,gh)


    Friday, November 25, 2011 9:38 PM
    Moderator

All replies

  • Hi,

    'Set a string variable to the URL
    imageURL = "http://ts3.mm.bing.net/images/thumbnail.aspx?q=1307362992378&id=e6c34a02c787e1d569801655eb6935e3&url=http%3a%2f%2fimages.sky-map.org%2fstar_image%2f000%2f000208.jpeg"
    'Download the image to a temp store
    imageStore = ImageList.LoadImage(imageURL)
    'Create a GraphicsWindow of a size you want
    gw = 800
    gh = 600
    GraphicsWindow.Width = gw
    GraphicsWindow.Height = gh
    'Load the image to the GraphicsWindow and scale it to the window size
    GraphicsWindow.DrawResizedImage(imageStore,0,0,gw,gh)


    Friday, November 25, 2011 9:38 PM
    Moderator
  • Thanks very much for the help. It works perfectly.

    Saturday, November 26, 2011 10:11 PM