Images & ASP.NET
Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=12175
Printed Date: 28 March 2026 at 11:07pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Images & ASP.NET
Posted By: neotrix
Subject: Images & ASP.NET
Date Posted: 15 October 2004 at 12:09am
Hello,
I dont really know asp.net very well, i just am good in classic asp.
But i want to ask these three questions if anyone here can answer me
please 
- Can i make thumbnails of imagins using asp.net ?!?
- will that require a component just like classic asp ??!
- can i add a water mark over images displayed in my site using asp.net ??!
All i know right now is that my site supports .net but i dont know how
to make thumbnails using asp.net, if someon can plz give me a link to a
page or something where i can find an easy way of learning to convert
full images to their thumbnails ?!?
Thanks in Advance.
Allah Hafiz!
------------- http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..
|
Replies:
Posted By: michael
Date Posted: 15 October 2004 at 5:15pm
- yes, very easily
- nope, all built in
- yes, also built in functionality
I have some code that does exactly that, let me know if you want to see...
------------- http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker
|
Posted By: neotrix
Date Posted: 16 October 2004 at 6:14am
ummmmm... how do i resize images ?!? 
any easy way ?!?
------------- http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..
|
Posted By: neotrix
Date Posted: 16 October 2004 at 8:26am
Ohk, here'z the code
<%@Import Namespace="System.Drawing.Imaging" %>
<script language="VB" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
'Read in the image filename to create a thumbnail of
Dim imageUrl as String = Request.QueryString("img")
'Make sure that the image URL doesn't contain any /'s or \'s
If imageUrl.IndexOf("/") >= 0 Or imageUrl.IndexOf("\") >= 0 then
'We found a / or \
Response.End()
End If
'Add on the appropriate directory
imageUrl = "/images/" & imageUrl
'Get the image.
Dim fullSizeImg as System.Drawing.Image
fullSizeImg = System.Drawing.Image.FromFile(Server.MapPath(imageUrl))
'Set the ContentType to "image/gif" and output the image's data
Response.ContentType = "image/gif"
fullSizeImg.Save(Response.OutputStream, ImageFormat.Gif)
End Sub
</script>
|
of http://www.cards.awazofasia.net/ShowImage.aspx - this page and http://cards.awazofasia.net/hjhj.jpg - this is the image i'm tring to work on, and i get http://cards.awazofasia.net/ShowImage.aspx?img=hjhj.jpg - this error! 
------------- http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..
|
Posted By: dpyers
Date Posted: 16 October 2004 at 11:13pm
customErrors mode="Off"
-------------
Lead me not into temptation... I know the short cut, follow me.
|
Posted By: neotrix
Date Posted: 17 October 2004 at 11:18am
do u think the code is ok ?!?
------------- http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..
|
Posted By: neotrix
Date Posted: 17 October 2004 at 11:29am
michael wrote:
I have some code that does exactly that, let me know if you want to see... |
Please? 
------------- http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..
|
|