472,325 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 software developers and data experts.

how to SAVE a CROPPED thumbnail of an uploaded image

I have an .aspx page from which users can upload an image. After a
file is uploaded, I also save a 60x60 pixel thumbnail of that image.
Works great.

What I can't seem to do is save a CROPPED thumbnail of that image that
does not stretch the image. Does anyone have code (VB please -- no
C#) that can do that?

Help would be appreciated. Here's what I have:

Dim imgFullSize, imgThumbnail As System.Drawing.Image
imgFullSize = System.Drawing.Image.FromFile(strBasePath &
Response.ContentType = "image/jpeg"
Dim objDummyCallBack As System.Drawing.Image.GetThumbnailImageAbort =
New System.Drawing.Image.GetThumbnailImageAbort( AddressOf
ThumbnailCallBack )
imgThumbnail = imgFullSize.GetThumbnailImage(60, 60, objDummyCallBack,
do while system.io.file.exists(strProposedFilename) = true
RandX = CLng(Int((9999999999 * Rnd()) + 1))
pos = strProposedFilename.lastindexof(".")
strFilenameExtension = strProposedFilename.substring(pos)
strProposedFilename = strProposedFilename.substring(0, pos) & RandX &
dim strFinalThumbnailFileName = strProposedFilename
s1= strFinalThumbnailFileName
pos=s1.lastindexof("\") +1
strFinalThumbnailFileName = s2
imgThumbnail.Save(strBasePath & strFinalThumbnailFileName,
Jul 21 '05 #1
0 986

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Michael Satterwhite | last post by:
I'm having trouble with the functions for resizing a picture uploaded to my server. Consider the following: $jpeg =...
by: Mark | last post by:
Hi all, I want to be able to resize an image that a user has uploaded. I have the image upload working as well as the image resize. When I go to...
by: moondaddy | last post by:
I have an app where users will upload photos to their shopping cart. When they review their cart I need to include a light weight thumbnail of the...
by: NATO24 | last post by:
Hello, I am trying to write a sub routine that I can pass a posted (image) file to. That routine will save the original file, then create a...
by: Matt Brelje | last post by:
I have an .aspx page from which users can upload an image. After a file is uploaded, I also save a 60x60 pixel thumbnail of that image. Works...
by: Xah Lee | last post by:
The following is a program to generate thumbnail images for a website. Useful, if you want to do that. It is used to generate the thumbnails for...
by: dodgeyb | last post by:
Hi there, Trying to allow client to upload image, thumbnail it, and save it into sql table image field. Code compiles & runs but image cannot be...
by: neovantage | last post by:
Hey all, i have created image by mixing logo and the original image. It create image and show in the same window. I have done 3 steps for this....
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or...
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.