Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Displaying users picture
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 13 January 2001 :  11:03:39  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
When the snitz forum tells it to display a users picture, it sets the height and the width to 150 without knowing the users existing picture height and width. this can cause the picture to get stretched and not look right. there is a function that can be used to generate the height and width and not strech the picture.


response.write "<img src=""graphic.gif"" " & ImageResize(strImageName, 150, 150) & ">"


the first 150 is the width, and the second one is the height. this should fix the problem



Brad

this looks more like a Design Request With Code to me, Gor..

Aznknight
Senior Member

USA
1373 Posts

Posted - 13 January 2001 :  17:11:39  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
Oh wow, what a useful function. Gotta try it out laters.

- Alan
alan@calvsa.net
www.calvsa.net
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 13 January 2001 :  17:32:37  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
yea, let me know how it works. i have actually never used it, but it should work, well thats what i read

Brad
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 13 January 2001 :  17:46:49  Show Profile
Where is this function coming from?

======
Doug G
======
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 13 January 2001 :  18:44:22  Show Profile
quote:
Where is this function coming from?
Was wondering the same thing myself.

*----*----*----*----*----*----*----*----*
"Even when you feel you have nothing left,
You still have prayer--And that's enough."

*----*----*----*----*----*----*----*----*
Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 13 January 2001 :  19:12:48  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
quote:

there is a function that can be used to generate the height and width and not strech the picture.



Hey brad,

I just tried it and there's no such ImageResize function. Where did you read about it?

In order to resize the picture dynamically I'm using ASPIMAGE server component that does this on server side.

- Alan
alan@calvsa.net
www.calvsa.net
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 14 January 2001 :  02:42:06  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
i do not remember where i read it, im looking now to see where i read it. i will post the link as soon as i fidn it

Brad
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 14 January 2001 :  04:13:40  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
ok i finally found it

http://www.4guysfromrolla.com/webtech/011201-1.shtml

thats the article i read. i would think they would know what they are doing before the posted the article, but who knows. it sounds like he used this function on a job he did

Brad
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 14 January 2001 :  04:47:59  Show Profile  Visit gor's Homepage
Brad,

If you had read the article a bit closer, you would have seen that you didn't tell the whole story.
In the article they also give the code for the function ImageResize that is needed to get this to work.


function ImageResize(strImageName, intDesiredWidth, intDesiredHeight)
dim TargetRatio
dim CurrentRatio
dim strResize
dim w, h, c, strType

if gfxSpex(strImageName, w, h, c, strType) = true then
TargetRatio = intDesiredWidth / intDesiredHeight
CurrentRatio = w / h
if CurrentRatio > TargetRatio then ' We'll scale height
strResize = "width=""" & intDesiredWidth & """"
else
' We'll scale width
strResize = "height=""" & intDesiredHeight & """"
end if
else
strResize = ""
end if

ImageResize = strResize
end Function


Pierre
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 14 January 2001 :  13:09:04  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
ops my brad i found it late at night one night and i guess i was a little more tired then i thought. thanks gor for helping me stay in line, well anyway that would help so the pic does not get all screwed up

Brad
Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 14 January 2001 :  14:57:32  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
quote:

Brad,

If you had read the article a bit closer, you would have seen that you didn't tell the whole story.
In the article they also give the code for the function ImageResize that is needed to get this to work.


function ImageResize(strImageName, intDesiredWidth, intDesiredHeight)
dim TargetRatio
dim CurrentRatio
dim strResize
dim w, h, c, strType

if gfxSpex(strImageName, w, h, c, strType) = true then
TargetRatio = intDesiredWidth / intDesiredHeight
CurrentRatio = w / h
if CurrentRatio > TargetRatio then ' We'll scale height
strResize = "width=""" & intDesiredWidth & """"
else
' We'll scale width
strResize = "height=""" & intDesiredHeight & """"
end if
else
strResize = ""
end if

ImageResize = strResize
end Function


Pierre



What about the gfxSpex function call? Doesn't look like a built in function to me.
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 17 January 2001 :  19:04:38  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
all the code would not fit in this forum so to view this code goto...

http://www.freeaspcode.net/snitz/adjust_image_size.txt



Brad
Go to Top of Page

evehawk
New Member

Australia
65 Posts

Posted - 17 January 2001 :  20:12:42  Show Profile  Send evehawk an ICQ Message
i use a simple way to fix this and i suppect it only work in IE but not with other browsers (i cant install netscape on my system to test this, the silly thing crash my puta grrr...).
If you opmit the height = ".." tag inside the image tag and only specify the width tag then IE will auto-scale the image for you correctly.
You can see the what i mean here: http://eve.121host.net/forum/topic.asp?TOPIC_ID=18&FORUM_ID=9&CAT_ID=5&Topic_Title=What a wonderful site%21&Forum_Title=Test Forum
Isis's picture scaled correctly on topic post as well as in her profile if you look at it.



Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 18 January 2001 :  06:28:27  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
could someone please test this to see if this would be a problem in other browsers? maybe even a little javascript to check the users browser and if its ie then it removes the height, any ideas?

Brad
Go to Top of Page

MetaMorphic
Starting Member

4 Posts

Posted - 27 February 2001 :  16:11:01  Show Profile  Send MetaMorphic an ICQ Message
I am trying to get this code to work with my database. However, it keeps ignoring my resize.

<%response.write( "<img src=" & rsRecordSet("thumbnail") & ImageResize(strImageName, 100, 75) & ">")%></a>

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07