Displaying pictures from the internet

Discussion in 'Questions (Windows Mobile)' started by N1c0_ds, Nov 15, 2008.

  1. N1c0_ds

    N1c0_ds Active Member Licensed User

    What would be the best way to display pictures from the internet?

    I have GIF, JPG, BMP and PNG screenshots of various sizes (QVGA, SQVGA and VGA, mostly) that I'd like to display. There would be a thumbnail and when it's clicked it would display the full picture.

    All the files are at an address specified in an SQL database. Any clue on how this could be done really quickly?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can download images with the HTTP library.
    The door library is required if you want to create a new bitmap object from the data stream, without first saving the image to a file.
    See the attached file.
    Code:
    Sub Globals
        
    End Sub

    Sub App_Start
        Form1.Show
        WebResponse.New1
        obj.New1(
    False)
        objArray.New1(
    1)
        ShowImage(
    "http://www.basic4ppc.com/images/logo.bmp")
    End Sub

    Sub ShowImage (URL)
        WebRequest.New1(URL)
           WebResponse.Value = WebRequest.GetResponse 
    'Download the image
        objArray.SetObject(0,WebResponse.GetStream) 
        obj.CreateNew2(
    "System.Drawing.Bitmap" & obj.System_Drawing,objArray.Value) 'Create a bitmap image from the
        'data stream.
        Form1.Image = obj.Value 'Assign the image to Form1.
    End Sub
     

    Attached Files:

    • 1.sbp
      File size:
      806 bytes
      Views:
      114
  3. N1c0_ds

    N1c0_ds Active Member Licensed User

    Sweet! I'll try it as soon as possible, thanks.
     
  4. N1c0_ds

    N1c0_ds Active Member Licensed User

    It works well but I was wondering...

    Are PNG images supported on the device?
     
  5. Cableguy

    Cableguy Expert Licensed User

    The device does show the image but will not show transparet (ALPHA CHANNEL) collors and in some images simply error out.
     
  6. N1c0_ds

    N1c0_ds Active Member Licensed User

    Error out?
     
  7. ExcludeReality

    ExcludeReality Active Member Licensed User

    Just shows a blank image
     
  8. N1c0_ds

    N1c0_ds Active Member Licensed User

    I'm trying to make thumbnails with the pictures but my code doesn't work

    img is my Imageclass object (dzImage) used to get image dimensions and select the thumbnail size based on it. imge is a picture control.
    Code:
    Sub Globals
      
    Dim Type(Width, Height) ImgSize
    End Sub

    Sub App_Start
    img.New1
        Form1.Show
        WebResponse.New1
        obj.New1(
    False)
        objArray.New1(
    1)
        
        ShowImage(
    "http://battellemedia.com/images/goog%20no%20count.jpg")
    End Sub

    Sub ShowImage (URL)

        WebRequest.New1(URL)
           WebResponse.Value = WebRequest.GetResponse 
    'Download the image
        objArray.SetObject(0,WebResponse.GetStream) 
        obj.CreateNew2(
    "System.Drawing.Bitmap" & obj.System_Drawing,objArray.Value) 'Create a bitmap image from the
        'data stream.
        Img.ImageSize(obj.Value)
        Img.ZoomImage(obj.Value,
    20)
        Img.RotateImage(obj.Value,
    90)
        Imge.Image=obj.Value
    End Sub
    The image is shown but modifications never apply.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice