Hi
I am a relative newcomer and as usual I am stuck. My ASP.Net 2003 app
has a page which shows data from a database plus an associated picture.
I use an ASP image control sized to 300x300px. All the images are
already the right size - ie maximum 300px, but this control stretches
the (usually non-square) image to fit the 300x300 area, and I don't
want distorted images.
>From scouring the net it seems the answer is to create an HTML <IMG>
tag, but while I can format that string, how do I get that into the
HTML for my page dynamically?
Apologies if this is a basic issue but I can't find any clues anywhere
and really appreciate any pointers.
Cheers
Dave 7 1291
Just set the asp:image control's height OR width, not both and you'll be all
set.
"Dave Keen" <da********@hotmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi
I am a relative newcomer and as usual I am stuck. My ASP.Net 2003 app
has a page which shows data from a database plus an associated picture.
I use an ASP image control sized to 300x300px. All the images are
already the right size - ie maximum 300px, but this control stretches
the (usually non-square) image to fit the 300x300 area, and I don't
want distorted images.
>>From scouring the net it seems the answer is to create an HTML <IMG>
tag, but while I can format that string, how do I get that into the
HTML for my page dynamically?
Apologies if this is a basic issue but I can't find any clues anywhere
and really appreciate any pointers.
Cheers
Dave
Hi Scott
Thanks for your post. I tried that, but couldn't work out how to
convert an integer value to the required format, which is
system.web.ui.webcontrols.unit. Sorry to be a pain but how is that
done?
Cheers
Dave
Scott M. wrote:
Just set the asp:image control's height OR width, not both and you'll be all
set.
"Dave Keen" <da********@hotmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi
I am a relative newcomer and as usual I am stuck. My ASP.Net 2003 app
has a page which shows data from a database plus an associated picture.
I use an ASP image control sized to 300x300px. All the images are
already the right size - ie maximum 300px, but this control stretches
the (usually non-square) image to fit the 300x300 area, and I don't
want distorted images.
>From scouring the net it seems the answer is to create an HTML <IMG>
tag, but while I can format that string, how do I get that into the
HTML for my page dynamically?
Apologies if this is a basic issue but I can't find any clues anywhere
and really appreciate any pointers.
Cheers
Dave
Dave Keen wrote:
Hi
I am a relative newcomer and as usual I am stuck. My ASP.Net 2003 app
has a page which shows data from a database plus an associated picture.
I use an ASP image control sized to 300x300px. All the images are
already the right size - ie maximum 300px, but this control stretches
the (usually non-square) image to fit the 300x300 area, and I don't
want distorted images.
From scouring the net it seems the answer is to create an HTML <IMG>
tag, but while I can format that string, how do I get that into the
HTML for my page dynamically?
Apologies if this is a basic issue but I can't find any clues anywhere
and really appreciate any pointers.
Cheers
Dave
Surprise! Your <ASP:IMAGEactually renders as an HTML <IMGtag.
So a part of the answer you found has already been implemented.
The question now becomes: How do i force my images to 300px wide
(stretch/compress as required) , preserving the aspect ratio?
A little experimentation reveals that the ASP:IMAGE control is smarter
that it looks. Leave the width attribute(300px) and drop the Height
attribute. The control will figure out the reset.
Having said that, you can always modify the control properties in code
(where I presume you know the dimentions of your image)
example
imgX.Width = New WebControls.Unit(300, UnitType.Pixel)
imgX.Height = New WebControls.Unit(100, UnitType.Pixel)
Where imgX was defined as
<ASP:IMAGE Runat="server" Width="300" ID="imgX" ...
Hope this helps
-- addup --
PS: Just as a matter of curiosity: How are you getting your image from
the DB into the image control?
Hi
Thanks for this. I don't know which dimension will be less than 300 in
advance, so although your HTML method works well I can't use it in this
case.
The converting/resizing works a treat. You are a lifesaver.
To answer your point, I am not storing my image in the DB, but in a
folder on the server. The record ID is used to decide the name of the
image. I was wondering whether it was better to do it this way or
experiment with holding pictures in the table (I am using SQL Server).
What do you recommend?
Cheers
Dave
addup wrote:
Dave Keen wrote:
Hi
I am a relative newcomer and as usual I am stuck. My ASP.Net 2003 app
has a page which shows data from a database plus an associated picture.
I use an ASP image control sized to 300x300px. All the images are
already the right size - ie maximum 300px, but this control stretches
the (usually non-square) image to fit the 300x300 area, and I don't
want distorted images.
>From scouring the net it seems the answer is to create an HTML <IMG>
tag, but while I can format that string, how do I get that into the
HTML for my page dynamically?
Apologies if this is a basic issue but I can't find any clues anywhere
and really appreciate any pointers.
Cheers
Dave
Surprise! Your <ASP:IMAGEactually renders as an HTML <IMGtag.
So a part of the answer you found has already been implemented.
The question now becomes: How do i force my images to 300px wide
(stretch/compress as required) , preserving the aspect ratio?
A little experimentation reveals that the ASP:IMAGE control is smarter
that it looks. Leave the width attribute(300px) and drop the Height
attribute. The control will figure out the reset.
Having said that, you can always modify the control properties in code
(where I presume you know the dimentions of your image)
example
imgX.Width = New WebControls.Unit(300, UnitType.Pixel)
imgX.Height = New WebControls.Unit(100, UnitType.Pixel)
Where imgX was defined as
<ASP:IMAGE Runat="server" Width="300" ID="imgX" ...
Hope this helps
-- addup --
PS: Just as a matter of curiosity: How are you getting your image from
the DB into the image control?
You don't need to convert anything. Just set the width or height property
of the ASP:IMAGE control at design time.
<ASP:IMAGE ID="blah" WIDTH="300px" IMGURL="blah" />
"Dave Keen" <da********@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi Scott
Thanks for your post. I tried that, but couldn't work out how to
convert an integer value to the required format, which is
system.web.ui.webcontrols.unit. Sorry to be a pain but how is that
done?
Cheers
Dave
Scott M. wrote:
>Just set the asp:image control's height OR width, not both and you'll be all set.
"Dave Keen" <da********@hotmail.comwrote in message news:11**********************@i42g2000cwa.googleg roups.com...
Hi
I am a relative newcomer and as usual I am stuck. My ASP.Net 2003 app
has a page which shows data from a database plus an associated picture.
I use an ASP image control sized to 300x300px. All the images are
already the right size - ie maximum 300px, but this control stretches
the (usually non-square) image to fit the 300x300 area, and I don't
want distorted images.
From scouring the net it seems the answer is to create an HTML <IMG>
tag, but while I can format that string, how do I get that into the
HTML for my page dynamically?
Apologies if this is a basic issue but I can't find any clues anywhere
and really appreciate any pointers.
Cheers
Dave
Holding the images in the table or as files is simply a design choice. You
can save some (not too much) hard drive space by storing them in the
database. But implementing this is more work to set up.
"Dave Keen" <da********@hotmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hi
Thanks for this. I don't know which dimension will be less than 300 in
advance, so although your HTML method works well I can't use it in this
case.
The converting/resizing works a treat. You are a lifesaver.
To answer your point, I am not storing my image in the DB, but in a
folder on the server. The record ID is used to decide the name of the
image. I was wondering whether it was better to do it this way or
experiment with holding pictures in the table (I am using SQL Server).
What do you recommend?
Cheers
Dave
addup wrote:
>Dave Keen wrote:
Hi
I am a relative newcomer and as usual I am stuck. My ASP.Net 2003 app
has a page which shows data from a database plus an associated picture.
I use an ASP image control sized to 300x300px. All the images are
already the right size - ie maximum 300px, but this control stretches
the (usually non-square) image to fit the 300x300 area, and I don't
want distorted images.
From scouring the net it seems the answer is to create an HTML <IMG>
tag, but while I can format that string, how do I get that into the
HTML for my page dynamically?
Apologies if this is a basic issue but I can't find any clues anywhere
and really appreciate any pointers.
Cheers
Dave
Surprise! Your <ASP:IMAGEactually renders as an HTML <IMGtag. So a part of the answer you found has already been implemented.
The question now becomes: How do i force my images to 300px wide (stretch/compress as required) , preserving the aspect ratio?
A little experimentation reveals that the ASP:IMAGE control is smarter that it looks. Leave the width attribute(300px) and drop the Height attribute. The control will figure out the reset.
Having said that, you can always modify the control properties in code (where I presume you know the dimentions of your image)
example imgX.Width = New WebControls.Unit(300, UnitType.Pixel) imgX.Height = New WebControls.Unit(100, UnitType.Pixel)
Where imgX was defined as <ASP:IMAGE Runat="server" Width="300" ID="imgX" ...
Hope this helps
-- addup -- PS: Just as a matter of curiosity: How are you getting your image from the DB into the image control?
Hi Scott
Thanks for this. I don't think space is a major issue so I will keep
with the separate files for now as I already have that working.
Cheers
Dave
Scott M. wrote:
Holding the images in the table or as files is simply a design choice. You
can save some (not too much) hard drive space by storing them in the
database. But implementing this is more work to set up.
"Dave Keen" <da********@hotmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hi
Thanks for this. I don't know which dimension will be less than 300 in
advance, so although your HTML method works well I can't use it in this
case.
The converting/resizing works a treat. You are a lifesaver.
To answer your point, I am not storing my image in the DB, but in a
folder on the server. The record ID is used to decide the name of the
image. I was wondering whether it was better to do it this way or
experiment with holding pictures in the table (I am using SQL Server).
What do you recommend?
Cheers
Dave
addup wrote:
Dave Keen wrote:
Hi
I am a relative newcomer and as usual I am stuck. My ASP.Net 2003 app
has a page which shows data from a database plus an associated picture.
I use an ASP image control sized to 300x300px. All the images are
already the right size - ie maximum 300px, but this control stretches
the (usually non-square) image to fit the 300x300 area, and I don't
want distorted images.
>From scouring the net it seems the answer is to create an HTML <IMG>
tag, but while I can format that string, how do I get that into the
HTML for my page dynamically?
Apologies if this is a basic issue but I can't find any clues anywhere
and really appreciate any pointers.
Cheers
Dave
Surprise! Your <ASP:IMAGEactually renders as an HTML <IMGtag.
So a part of the answer you found has already been implemented.
The question now becomes: How do i force my images to 300px wide
(stretch/compress as required) , preserving the aspect ratio?
A little experimentation reveals that the ASP:IMAGE control is smarter
that it looks. Leave the width attribute(300px) and drop the Height
attribute. The control will figure out the reset.
Having said that, you can always modify the control properties in code
(where I presume you know the dimentions of your image)
example
imgX.Width = New WebControls.Unit(300, UnitType.Pixel)
imgX.Height = New WebControls.Unit(100, UnitType.Pixel)
Where imgX was defined as
<ASP:IMAGE Runat="server" Width="300" ID="imgX" ...
Hope this helps
-- addup --
PS: Just as a matter of curiosity: How are you getting your image from
the DB into the image control?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: news |
last post by:
Before I begin, I realise there's a big war regarding HTML in e-mails.
Personally, I don't like it. Unfortunately, I'm being paid by my
company to create an automated newsletter for our customers....
|
by: Desigan Chinniah |
last post by:
I am presently trying to display a list of items INLINE using an image as a
seperator..... and having difficulties....
See below for 3 seperate sets of html and css files. Each set does something...
|
by: Mat |
last post by:
<div id="container">
<div id="main">
<div id="header">
<p class="Address">123 Fake Street, </p>
<p class="City">Crazy City, </p>
<p class="Province">Ontario </p>
<p class="PostalCode">H0H...
|
by: yawnmoth |
last post by:
http://www.frostjedi.com/terra/dev/test.html
I'd like to have the colored boxes appear on the same line as "Test"
does. The div containing the colored boxes is defined as being inline,
yet...
|
by: Tony Johansson |
last post by:
Hello experts!
I'm reading a book about C++ and there is something about inline that the
book says that is unclear for me.
The book says the following "Because inline functions are expanded at...
|
by: enak |
last post by:
I have found some code that shows how to convert an html
form to Word. The message said to simply put the following
in the Page_load:
Response.ContentType = "application/ms-word"...
|
by: andym |
last post by:
Dear All,
I wish to have an ASP page that displays a predetermined date in the
middle of a string. I wish this date to be set in a seperate control
panel type page. I am hoping somebody could...
|
by: Jan Callewaert |
last post by:
When compiling a library with the intel compiler icpc, I get the following
warning:
ld: warning: creating a DT_TEXTREL in object
This happens with icc-9.0.030 and ld-2.16.1. However, this...
|
by: mk189 |
last post by:
Hi,
I am trying to create XML schema of custom markup language, enriched
by XHTML. In simplified version, the XML documet could look like that:
<a:alarm-manual
xmlns:a="alarm-manual"...
|
by: Prisoner at War |
last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits'
end: I want to make bold several lines of text which have a pair of
<br /tags between them...seems like the <b></bdo not "carry...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |