Dynamic Image Generation using Mobile Image Control

Discussion in 'ASP .Net Mobile' started by Waverider, Sep 15, 2004.

  1. Waverider

    Waverider Guest

    Hi,

    I'm trying to implemet some code that dynamically re-scales an image for a mobile image control. The code works fine when I browse to it in Internet Explorer but not when I browse to it on a mobile device, I just get a blank image with a red cross through it. It's got me flummoxed....any ideas.

    Here's my code...

    to fill my Image control

    Image1.ImageUrl = ("img.aspx?image=/Images/logo_003.gif&height128&width128")
    and the code inside the page load event of img.aspx

    Try

    Dim _image As String = Request.QueryString("image")
    Dim _height As Int32 = Convert.ToInt32(Request.QueryString("height"))
    Dim _width As Int32 = Convert.ToInt32(Request.QueryString("width"))

    Dim bitmapname As String = Request.PhysicalApplicationPath + _image
    Dim bmpsize As New System.Drawing.Size(_width, _height)


    Dim bmpFile As New Bitmap(bitmapname)
    Dim bmpfile2 As New Bitmap(bmpFile, bmpsize)

    Response.ContentType = "image/gif"
    bmpfile2.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif)

    Catch ex As Exception

    End Try
     
    Waverider, Sep 15, 2004
    #1
    1. Advertising

  2. Waverider

    JuanDG Guest

    Well I really support your creativity, but if what you really need is to get
    images scaled to the proper size for the devices, you better get this control
    done by Joseph Croney at Microsoft.

    http://www.asp.net/ControlGallery/ControlDetail.aspx?Control=185&tabindex=2

    cheers!!

    --

    Juan David Gomez A.
    Microsoft Certified Professional
    Analista de Desarrollo - PSL S.A.
    Web and Wireless Banking
    Medellin - Colombia


    "Waverider" wrote:

    > Hi,
    >
    > I'm trying to implemet some code that dynamically re-scales an image for a mobile image control. The code works fine when I browse to it in Internet Explorer but not when I browse to it on a mobile device, I just get a blank image with a red cross through it. It's got me flummoxed....any ideas.
    >
    > Here's my code...
    >
    > to fill my Image control
    >
    > Image1.ImageUrl = ("img.aspx?image=/Images/logo_003.gif&height128&width128")
    > and the code inside the page load event of img.aspx
    >
    > Try
    >
    > Dim _image As String = Request.QueryString("image")
    > Dim _height As Int32 = Convert.ToInt32(Request.QueryString("height"))
    > Dim _width As Int32 = Convert.ToInt32(Request.QueryString("width"))
    >
    > Dim bitmapname As String = Request.PhysicalApplicationPath + _image
    > Dim bmpsize As New System.Drawing.Size(_width, _height)
    >
    >
    > Dim bmpFile As New Bitmap(bitmapname)
    > Dim bmpfile2 As New Bitmap(bmpFile, bmpsize)
    >
    > Response.ContentType = "image/gif"
    > bmpfile2.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif)
    >
    > Catch ex As Exception
    >
    > End Try
    >
    >
    >
     
    JuanDG, Sep 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. moondaddy
    Replies:
    3
    Views:
    549
    Steven Cheng[MSFT]
    Jul 1, 2004
  2. Cat 22
    Replies:
    10
    Views:
    783
    Doug Miller
    Jan 3, 2010
  3. chen selina
    Replies:
    0
    Views:
    1,341
    chen selina
    Jul 13, 2010
  4. dawson
    Replies:
    0
    Views:
    173
    dawson
    Jul 12, 2005
  5. John W. Long

    HTML Generation (Next Generation CGI)

    John W. Long, Nov 22, 2003, in forum: Ruby
    Replies:
    4
    Views:
    357
    John W. Long
    Nov 24, 2003
Loading...

Share This Page