Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Thumbnail an image

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
Do you know of any free components out there that will make an image a thumbnail? www.vzio.com
ASP WEB DEVELOPMENT



 
hi snowboardr,
the best way I know of is a simple javascript function like this
<script>
function thumb(URL) {
newwin=window.open(URL, &quot;popup&quot;);
}
</script>

pass the image location to the function from the link.
example
<a href=&quot;#&quot; onClick=&quot;thumb('image.gif')&quot;>
you will have seemingly more control over the size etc.. of the popup from the image thumbnail this way. of course incorporating ASP is not a difficult task either into this function.

here is a good one using the width and height of the image to size the image which takes out a few headaches.
function thumb(url)
{
Timg = new Image();
Timg.src = url;
Timg.onLoad = openWin(Timg, url)
}
function openWin(Timg, url)
{
winWidth = Timg.Width;
winHeight = Timg.Height;

newwindow = window.open('', '', 'resizable=yes,width='+winWidth+',height='+winHeight+',top=0,screenY=0');
doc = newwindow.document;
doc.write(&quot;<html><head></head><body marginheight='0' marginwidth='0' topmargin='0' leftmargin='0'>&quot;);
doc.write(&quot;<p><img src='&quot; + url + &quot;'></p>&quot;);
doc.write(&quot;</body></html>&quot;);
}

to call
<a href=&quot;#&quot; onClick=&quot;openImage('image.gif')&quot;><img src=&quot;&quot;></a> A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
the call should be
<a href=&quot;#&quot; onClick=&quot;thumb('image.gif')&quot;><img src=&quot;&quot;></a>
in the second example A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
I am talking about actully shrinking an image down so if a user submits their picture then I can create a thumbnail of it forums.. www.vzio.com
ASP WEB DEVELOPMENT



 
snowboardr, you should have a look at
They list all sorts of asp components and I know I've seen one in the past that does just what you're looking for! i love chocolate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top