PDA

View Full Version : AspJpeg and repeater


onirik
04-13-2005, 02:54 AM
Hello,

I need some help with AspJpeg and repeater. I'd like to create a thumbnail from thepath of the image stocked in a database.
ex: "/images/mypic.jpg"

here is the code I used:

sub resizeimg(o as object)

dim mypath as string = CStr(o)
Response.Expires = 0
' create instance of AspJpeg
dim Jpeg = Server.CreateObject("Persits.Jpeg")
' Open source file
Jpeg.Open( Request(mypath) )

' Set new height and width
Jpeg.Height = 144
Jpeg.Width = Jpeg.Originalwidth * 144 / Jpeg.Originalheight
' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary

end sub

and here is the part of the repeater:

resizeimg(DataBinder.Eval(Container.DataItem, "im_dvd"))

I tryed several solutions with .tostring() and a string instead of an object in the sub ...but I always has the same error: BC30518: Overload resolution failed because no accessible 'ToString' can be called with these arguments:

How can I generate a thumb inside the repeater from the path stock in db???

thanks