PDA

View Full Version : ASP.net - thumbnail viewing problems


david7777
03-11-2003, 01:53 PM
I am currently trying to convert my asp shopping cart system to asp.net, and want to take advantage of the GetThumbnailImage() method.

I went to the microsoft site to see what i could find and came up with: (Slightly edited to convert from C# to VB)


public sub ThumbnailCallback() as boolean
return false
end sub

public sub Example_GetThumb(e as System.Windows.Forms.PaintEventArgs)
dim myCallback as Image.GetThumbnailImageAbort
dim myBitmap as Bitmap
dim myThumbnail as Image


myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback)
myBitmap = new Bitmap("intro.jpg")
myThumbnail = myBitmap.GetThumbnailImage(40, 40, myCallback, IntPtr.Zero)
e.Graphics.DrawImage(myThumbnail, 150, 75)
end sub



My problem is: where do i get a "PaintEventArgs" from? How do i call this? Or is there a better way?

All i am trying to do is:

I have a big image in a database. I fetch this image and turn it into the thumbnail for basic display in a search. How do i do that?

I was thinking of having an asp page that takes in a QueryString of image id. This page does all the work, by fetching the image from the database, then manipulating it to make it a thunmbnail, then returns the binary data as a jpg / gif file.

So in my search results page, the source of the image would be the asp file. ie: <img src="../../smallImage.aspx?id=123">

Can anyone help?

allida77
03-11-2003, 03:21 PM
Check out:

http://aspnet.4guysfromrolla.com/articles/012203-1.aspx
or
http://www.aspalliance.com/chrisg/default.asp?article=21

david7777
03-11-2003, 03:30 PM
Unbelievable... I have searched almost everywhere for that kind of explenation, but no - nothing. Then you come along and give me 2 links to my dream come true. Its just not my asp.net-day! (Until now :))

Thanx a million! Your a life saver!