473,388 Members | 1,209 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

ThumbnailImage

If I want to reduce an image I can do as follows:

Sub sub1()
Dim FileUrl As String = Server.MapPath("") & "\a.jpg"
Dim ima As New System.Drawing.Bitmap(FileUrl)
Dim inp As New IntPtr()
Dim ima2 As System.Drawing.Bitmap
ima2 = ima.GetThumbnailImage(100, 100, Nothing, inp)
Response.ContentType = "image/jpeg"
ima2.Save(Response.OutputStream, ima.RawFormat)
ima.Dispose()
ima2.Dispose()
End Sub

or

Sub sub2()
Dim FileUrl As String = Server.MapPath("") & "\a.jpg"
Dim ima As New System.Drawing.Bitmap(FileUrl)
Dim ima2 As New System.Drawing.Bitmap(ima, 100, 100)
Response.ContentType = "image/jpeg"
ima2.Save(Response.OutputStream, ima.RawFormat)
ima.Dispose()
ima2.Dispose()
End Sub

what are the advantages of GetThumbnailImage? I can the same thing without
using it.
--

Giuseppe
Nov 23 '05 #1
1 1065
"Giuseppe Dini" <gi******@libero.it> schrieb:
what are the advantages of GetThumbnailImage? I can the same thing
without using it.


'GetThumbnailImage' will return a thumbnail image which is embedded into the
image, if present. This would make getting the thumbnails faster. However,
the quality of embedded thumbnails is often horrible.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #2

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

Similar topics

5
by: Andrew Banks | last post by:
Is it possible to use GetThumbnailImage with images being pulled from an SQL DB and if so how? All examples I've seen refer to working with an actual image stored on the server. My code for...
0
by: Duncan Welch | last post by:
I've got users uploading a file, which I then want resize, make a thumbnail out of, then delete. The image and thumbnail are working fine, but when I try to delete the image, I get an error: "The...
4
by: SlasherStanley | last post by:
BlankHi How do you resize a jpg file. I want to open a file (c:\abc.jpg 800 x 600) and resize it as 120 x 100, I then want to save it as c:\abc_t.jpg. Thanks Slasher
0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
1
by: nicholas | last post by:
Why is this not working ?? <asp:Image ID="myimage" ImageUrl='/aspx_scripts/thumbnailimage.aspx?filename=/files/products/image1/ <%# DataBinder.Eval(Container.DataItem, "productID") %><%#...
2
by: Adam J Knight | last post by:
Hi all, I am trying resize an image using the following code. //resize image System.Drawing.Image ImageUpload =...
11
by: Parrot | last post by:
Is there any routine I can call to reduce the size of an image file after uploading a file from a client. I am looking to reduce file sizes programmatically using C# in my web page after uploading....
1
by: Blasting Cap | last post by:
I am using the following code to pull an image out of a database & display it on a web page. Dim data As New data Dim sID As String = Request.Params("itemID") Dim sqlConnection As New...
5
by: captainB | last post by:
Hi, I'm building a simple online image gallery that allows users to download full size images for free with one condition - they must submit their name and why the chose the image. I want to use a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.