Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > problem sizing images

Reply
Thread Tools

problem sizing images

 
 
Jeff
Guest
Posts: n/a
 
      04-03-2009
hi

asp.net 2.0

I have this markup on my webpage. The problem with this markup is that a
picture can appear to be stretched. Specially is this notable on portrate
photos - photos where height is higher than width

<asp:Image ID="Image1" runat="server" Width="700" Height="300" />

So I'm looking for a way to keep the relationship between the height and
width. Lets say original picture has size with:800, height:600. Then I want
to keep the relationship between those properties while I scale down the
picture so it's not larger than with:700 and height:500... maybe in this
scenario the with should be 500 and height 300...

any suggestions?


 
Reply With Quote
 
 
 
 
Jeff
Guest
Posts: n/a
 
      04-03-2009
i suppose I've fixed it by setting only the with tag:
<asp:Image ID="Image1" runat="server" Width="500" />


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      04-03-2009
On Apr 3, 10:05*am, "Jeff" <(E-Mail Removed)> wrote:
> hi
>
> asp.net 2.0
>
> I have this markup on my webpage. The problem with this markup is that a
> picture can appear to be stretched. Specially is this notable on portrate
> photos - photos where height is higher than width
>
> <asp:Image ID="Image1" runat="server" Width="700" Height="300" />
>
> So I'm looking for a way to keep the relationship between the height and
> width. Lets say original picture has size with:800, height:600. Then I want
> to keep the relationship between those properties while I scale down the
> picture so it's not larger than with:700 and height:500... maybe in this
> scenario the with should be 500 and height 300...
>
> any suggestions?


You can use CSS for this. For example,

..resize {
width: 300px;
height : auto;
}


It will resize the images by keeping width as 300 pixels.

Use CssClass property of <asp:Image> to set class to the control

Hope this helps.
 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      04-13-2009
On 3 Apr., 11:53, "Patrice" <http://www.chez.com/scribe/> wrote:
> Not sure what is the original size but keep in mind that you still have to
> download the image file even if this is just to display a much smaller
> version. So sometimes it's best to size the image when it is saved to the
> server so that you can have a *native version that has just the size (both
> in pixels and resulting file size) you need....
>
> --
> Patrice
>
> "Jeff" <(E-Mail Removed)> a écrit dans le message de groupe
> de discussion : #(E-Mail Removed)...
>
>
>
> > i suppose I've fixed it by setting only the with tag:
> > <asp:Image ID="Image1" runat="server" Width="500" */>- Zitierten Text ausblenden -

>
> - Zitierten Text anzeigen -


or you can resize on-the-fly
http://www.google.com/search?q=asp.n...ize+on-the-fly
 
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
IEx Hell (again): AUTO-SIZING IMAGES in Multiple Columns w/DIV Tags &CSS MISS CHIEVOUS HTML 51 04-19-2009 04:25 PM
Re: AUTO-SIZING YOUR <---W-I-D-E---> IMAGES in Older Versions of IEX(NÔÔB Friendly & Widescreen Ready!) dorayme HTML 0 02-20-2009 11:22 PM
Sizing background images James O'Riley HTML 6 05-03-2006 12:46 AM
Sizing Images Allen Flick HTML 14 01-15-2004 05:49 PM
Iframe sizing - child pages with images Jimbo Javascript 0 01-12-2004 04:10 PM



Advertisments