| Author |
Topic Search Topic Options
|
neotrix
Mod Builder Group
Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
|
Post Options
Thanks(0)
Quote Reply
Topic: Images & ASP.NET 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!
|
|
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
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...
|
|
|
 |
neotrix
Mod Builder Group
Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
|
Post Options
Thanks(0)
Quote Reply
Posted: 16 October 2004 at 6:14am |
ummmmm... how do i resize images ?!? 
any easy way ?!?
|
|
|
 |
neotrix
Mod Builder Group
Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
|
Post Options
Thanks(0)
Quote Reply
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 this page and this is the image i'm tring to work on, and i get this error!
|
|
|
 |
dpyers
Senior Member
Joined: 12 May 2003
Status: Offline
Points: 3937
|
Post Options
Thanks(0)
Quote Reply
Posted: 16 October 2004 at 11:13pm |
|
customErrors mode="Off"
|
Lead me not into temptation... I know the short cut, follow me.
|
 |
neotrix
Mod Builder Group
Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
|
Post Options
Thanks(0)
Quote Reply
Posted: 17 October 2004 at 11:18am |
do u think the code is ok ?!?
|
|
|
 |
neotrix
Mod Builder Group
Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
|
Post Options
Thanks(0)
Quote Reply
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?
|
|
|
 |