Re: image resizing

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Eric Lawrence [MSFT] (e_lawrence_at_hotmail.com)
Date: 02/21/04


Date: Fri, 20 Feb 2004 16:58:25 -0800

Basically. Can you save any file (E.g. a simple text file) from the ASP.NET
page into the target folder?

-- 
Thanks,
Eric Lawrence
Program Manager
Assistance and Worldwide Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brent Burkart" <Brent.Burkart@wvmb.com> wrote in message
news:uNTbCMA#DHA.2808@TK2MSFTNGP10.phx.gbl...
> I am not sure.  I have given my aspnet accounts permission to the folders.
> Is this what you are asking?
>
> "Eric Lawrence [MSFT]" <e_lawrence@hotmail.com> wrote in message
> news:emgi4F$9DHA.3900@tk2msftngp13.phx.gbl...
> > Does your application have permission to write to the filesystem?
> >
> > -- 
> > Thanks,
> >
> > Eric Lawrence
> > Program Manager
> > Assistance and Worldwide Services
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> > "Brent Burkart" <Brent.Burkart@wvmb.com> wrote in message
> > news:Oz6SNq89DHA.1504@TK2MSFTNGP12.phx.gbl...
> > > I have a shopping cart where I have a product page which has an image
> > > webcontrol.  In my code behind, I load pictures into the image
> webcontrol.
> > > I would like to dynamically resize the picture (mostly jpg's) before
> > > displaying the webpage.  I have read through some examples, but I am
> > having
> > > all kinds of problems saving my resized image.  A piece of my code is
> > below.
> > > I recieve the "A generic error occurred in GDI+" error when I do the
> save.
> > > Can anyone point out my problem.
> > >
> > > Thanks so much
> > >
> > > objImage = objImage.FromFile(Server.MapPath(strFilename))
> > >
> > >
> > > If objImage.Width > objImage.Height Then 'portrait
> > >
> > > shtWidth = 350
> > >
> > > ' Work out a proportionate height from width
> > >
> > > shtHeight = objImage.Height / (objImage.Width / shtWidth)
> > >
> > > Else 'landscape
> > >
> > > shtHeight = 370
> > >
> > > ' Work out a proportionate width from height
> > >
> > > shtWidth = objImage.Width / (objImage.Height / shtHeight)
> > >
> > > End If
> > >
> > > ' Create thumbnail
> > >
> > > objThumbnail = objImage.GetThumbnailImage(shtWidth, _
> > >
> > > shtHeight, Nothing, System.IntPtr.Zero)
> > >
> > > ' Send down to client
> > >
> > > Response.ContentType = "image/jpeg"
> > >
> > > objThumbnail.Save(Path.Combine(Server.MapPath(strPath), strFilename2 &
> > "2"),
> > > Imaging.ImageFormat.Jpeg)
> > >
> > > ProductImage.ImageUrl = strFilename2
> > >
> > > objImage.Dispose()
> > >
> > > objThumbnail.Dispose()
> > >
> > >
> >
> >
>
>


Relevant Pages