kennyaidan
Programmer
Hi, i am trying to create thumbnails using asp.net. I am trying to take in an image file and i create a thumbnail of that file. I think my code works fine until i have to give the thumbnail a name and save it. I have created a thumbnail using the following bits of a code
'declare thumbImage
Dim thumbImage as System.Drawing.Image
'declare currentImage, got from a control called MyFile
FileName.InnerHtml = MyFile.PostedFile.FileName
Dim currentImage as System.Drawing.Image = System.Drawing.Image.FromFile(FileName.InnerHtml)
'create thumbnail
thumbImage = currentImage.GetThumbnailImage(50, 50, nothing, nothing)
When i try to name and save "thumbImage"
Dim strFileName as string
strFileName = thumbImage
I get the following error
Value of type 'System.Drawing.Image' cannot be converted to 'String'.
Line 53: strFileName1 = thumbImage
I'm sure there is an easy way of doing this but i can't seem to find it. I want to be able to save "thumbImage"
as c:/my pictures/example_thb.gif
Any help greatly appreciated
thanks
aidan
'declare thumbImage
Dim thumbImage as System.Drawing.Image
'declare currentImage, got from a control called MyFile
FileName.InnerHtml = MyFile.PostedFile.FileName
Dim currentImage as System.Drawing.Image = System.Drawing.Image.FromFile(FileName.InnerHtml)
'create thumbnail
thumbImage = currentImage.GetThumbnailImage(50, 50, nothing, nothing)
When i try to name and save "thumbImage"
Dim strFileName as string
strFileName = thumbImage
I get the following error
Value of type 'System.Drawing.Image' cannot be converted to 'String'.
Line 53: strFileName1 = thumbImage
I'm sure there is an easy way of doing this but i can't seem to find it. I want to be able to save "thumbImage"
as c:/my pictures/example_thb.gif
Any help greatly appreciated
thanks
aidan