Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Mobile > Dynamic Image Generation using Mobile Image Control

Reply
Thread Tools

Dynamic Image Generation using Mobile Image Control

 
 
Waverider
Guest
Posts: n/a
 
      09-14-2004
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



 
Reply With Quote
 
 
 
 
JuanDG
Guest
Posts: n/a
 
      09-21-2004
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/Co...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
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iPhone4,iPhone3,Ipad,Apple Mobile,Blackberry Mobile,HTC Mobile,LGMobile,Motorola Mobile,Nokia Mobile,Samsung Mobile chen selina C++ 0 07-13-2010 08:53 AM



Advertisments