visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: Visual Basic :: Elsa


By: J.M. U.S.A.  Date: 23/01/2007 22:09:43  English German  Points: 20 Status: Answered
Quality : Excellent
Hi, i have an asp.net 2.0 web application. i need to create thumbnails for images. i retreive the images from a folder.
how can i create the thumnails, i found a method getThumbnail that must do it, but it didn't work with me
By: VGR Date: 23/01/2007 23:09:31 English  Type : Comment
Well, you can do it using a built-in or third-party library/DLL for jpeg/png images handling. You should search on your asp.net online documentation for "imageresize" or "imagecreatefromfile". PHP can natively do this. asp.net should also.

regards
By: VGR Date: 23/01/2007 23:15:01 English  Type : Comment
apparently, system.drawing.image is your friend and will enable you to assess image's width&height

the gd's imagecreatefromfile equivalent is System.Drawing.Image.FromFile()

but you probably already know all of this... As you found the GetThumbnailImage() method that you can apply on an object of type returned by System.Drawing.Image.FromFile()

You can nevertheless look at this page on ASP.Net thumbnail creation

good luck...

Alternatively, you can probably use a non-managed DLL like Delphi's TJPEG library. It's very efficient.
By: Elsa Date: 24/01/2007 08:47:07 English  Type : Answer
hey J.M., what's up?


Create an a class getImages.aspx, u don't to put anything in it.
Its code behind is this:

Imports Microsoft.VisualBasic
Imports System.Drawing
Imports System.Drawing.Drawing2D

Partial Class getImage
Inherits System.Web.UI.Page


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim folderFile = Server.MapPath(Request.QueryString("img"))
Dim oImage As System.Drawing.Image

oImage = System.Drawing.Image.FromFile(folderFile)
Dim iHeight = oImage.Height / 2
Dim iWidth = oImage.Width / 2


Response.ContentType = "image/jpeg"

Dim oThumbnail As System.Drawing.Image
oThumbnail = oImage.GetThumbnailImage(iWidth, iHeight, Nothing, Nothing)
oThumbnail.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
oImage.Dispose()
oThumbnail.Dispose()

End Sub
End Class

Now to display the thumbnail u do this:
<img src="getImage.aspx?img=imagePath/imageName" border=0 width=200/>
By: vb_elmar Date: 27/11/2007 00:45:59 German  Type : Comment
Test

Do register to be able to answer

EContact
browser fav
page generated in 302.532910 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page