PDA

View Full Version : scaling option with button


rico1931
06-08-2009, 07:39 PM
Hello Everyone

I was wondering if something could help me with this. I'm trying to write either an ASP function or JS or both to help me rescale a img in my DB...

Here is the scoop. I have a form that currently holds the original X and Y dimensions of a graphic. I just need something so a user can put in a percentage and hit a rescale button to calculate the new X and Y dimensions. so for example a user has a graphic 2000 x 1000 in the DB Next they type into a box 10% to be scaled. Next they hit a button and it figures that the new dimensions should be 200 x 100 then they can just click update and the new dimensions will be uploaded...

I just need help trying to figure out the ASP or JS for this i'm so stuck

Thanks!

rico1931
06-08-2009, 09:00 PM
Got the Answer in ASP


<%
Dim percent
Dim org

varsize1 = 'what ever your org size is'
varsize2 = Request.Form("PercentToResize")

If (varsize1 > 0) Then
org = ((varsize1 /100) * varsize2)
End If
%>
who would it thought to just be simple math :-P