Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
HELP:ASP writes property Widht and Height in image label
Old 04-03-2007, 07:49 PM HELP:ASP writes property Widht and Height in image label
Average Talker

Posts: 22
Name: pepe
Trades: 0
I am setting up an e-commerce app. made in ASP.
I am displaying products description and pictures from the database.
I have the following label:
<img border=0 src="images/<%=pImageCategory%>" alt="<%response.write pCategoryDesc%>">

What I need is to ASP to write the Width and Height property of each image from that label. Every image size is different to each other.

I supose it must be some script to do this.

Many thanks.
jmz2 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-03-2007, 07:53 PM Re: HELP:ASP writes property Widht and Height in image label
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Store the width and height of the images in a database. That's the easiest way.

Alternatively, ASPImage could be used to find the width and height (it's free and out there.)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 04-03-2007, 08:22 PM Re: HELP:ASP writes property Widht and Height in image label
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
For the record, you'll want to do this before hand, and store the values in the database. You don't want to slow your server down by opening up images just to find their height and width on a per-request basis.

You would want to create a second page that queries the database for a list of images that don't have this information attached, and then ( possibly using ASPImage ) collect it and update that record. This way you do the work only once, and can serve up data much faster to the client. The only trick becomes how to "schedule" calls to this new asp maintenance page.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 04-04-2007, 10:29 PM Re: HELP:ASP writes property Widht and Height in image label
Average Talker

Posts: 22
Name: pepe
Trades: 0
Thanks for the posting.
Do you know any script in order to fill in the widht and height of the images in the db?
I have been looking around but the ASPImage don't have proper documentation (or at least I don't find it).
Thks again.
jmz2 is offline
Reply With Quote
View Public Profile
 
Old 04-04-2007, 11:03 PM Re: HELP:ASP writes property Widht and Height in image label
Banned

Posts: 421
Location: Boston, MA
Trades: 1
There are many ways you can approach this problem to solve.
1. Retrieve the data, loop through to add them in arraylist or somthing like that(you may make an object also before putting in arraylist or so). Dont save the image width/height on DB. When you loop through you can create a Bitmap object (dont remember the exact method something like ImageFromFile..). Now you can use the bmp.Width bmp.Height property on your object (bmp is the Bitmap object)
----------------
I dont suggest this though. If you are creating an e-com solution I suggest you use css for thumbs, and other images. all thumbs should be same size.
You can use css like this:
.imgThumb {width:90px; height:110px;border:0;verttical-align:top;overflow:hidden;}
2. You can use javascript to detect the width/height.
3. You can define your <img> tag like this <img id="img1" runat="server" .....
if you are using asp server control. Then on itemdatabound get the width and height of that image control
webcosmo is offline
Reply With Quote
View Public Profile Visit webcosmo's homepage!
 
Old 04-17-2007, 03:21 AM Re: HELP:ASP writes property Widht and Height in image label
Average Talker

Posts: 21
Name: Robert Brue
Trades: 0
Quote:
Originally Posted by jmz2 View Post
What I need is to ASP to write the Width and Height property of each image from that label. Every image size is different to each other.
Mybe your design just need to have enough space for these images, if you need weight and height just because of your design movings while imgs are appearing? If images have enough fixed in size space your design will not shocked when imgs appear. So in this case you don't have to take yourself in weight and height problem's jungle.
__________________

Please login or register to view this content. Registration is FREE
- Get one way text links with different anchors for free.
Add your website here:

Please login or register to view this content. Registration is FREE
urlslivecom is offline
Reply With Quote
View Public Profile Visit urlslivecom's homepage!
 
Old 04-27-2007, 04:38 AM Re: HELP:ASP writes property Widht and Height in image label
Novice Talker

Posts: 14
Name: nick
Trades: 0
thz for sharing
torino is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to HELP:ASP writes property Widht and Height in image label
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24990 seconds with 12 queries