473,395 Members | 1,348 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,395 software developers and data experts.

Problems resizing image

I'm trying to rezive an image using the GetThumbnailImage method, and I'm
having some trouble with the GetThumbNailImageAbort delegate. It seems my
system doesn't think that
System.Drawing.Image.GetThumbNailImageAbort exists.

Any ideas? I think I've been staring at the computer for too long and I'm
missing something obvious because there's nothing in Google about other
people having this problem, and I know I've had this sort of code working
before.

Thanks

Colin
Nov 16 '05 #1
7 4394
In theory it's needed but in practice it's never called because the current
version will never abort a thumbnail.

Just create a dummy thumbnail abort handler and pass that to the
GetThumbnailImage routine.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Image transition effects, automatic persistent configuration and
design time mouse operations all in April's issue of Well Formed
http://www.bobpowell.net/wellformed.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder...aspx?FeedId=41

"Colin Young" <x@nospam.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
I'm trying to rezive an image using the GetThumbnailImage method, and I'm
having some trouble with the GetThumbNailImageAbort delegate. It seems my
system doesn't think that
System.Drawing.Image.GetThumbNailImageAbort exists.

Any ideas? I think I've been staring at the computer for too long and I'm
missing something obvious because there's nothing in Google about other
people having this problem, and I know I've had this sort of code working
before.

Thanks

Colin

Nov 16 '05 #2
Hi Colin,

Based on my understanding, you want to use GetThumbnailImage method, but
your program can not find GetThumbNailImageAbort delegate.

I am not sure why your program can not find the GetThumbNailImageAbort
delegate. GetThumbNailImageAbort should be in the same namespace with the
GetThumbnailImage method, also, they both belong to Image class, this
problem should not happen.

What error message do you get? Can you view the GetThumbNailImageAbort
delegate from the "Object Browser"? Also, you may try to use ILdasm.exe to
view the content of this System.Drawing.dll assembly, if
GetThumbNailImageAbort existed.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #3
The other issue aside, GetThumbNailImage is not a great way to resize
images. The method (as the name implies) is for creating thumbnails. If
you want to resize images, you should use the GDI+ call DrawImage on a
canvas that you created.

Pseudocode:

Bitmap bmp = new Bitmap(newWidth, newHeight);
Graphics gfx = Graphics.FromImage(bmp);
gfx.DrawImage(oldBitmap, 0, 0, newWidth, newHeight, 0, 0, oldWidth,
oldHeight);

-vJ

"Colin Young" <x@nospam.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
I'm trying to rezive an image using the GetThumbnailImage method, and I'm
having some trouble with the GetThumbNailImageAbort delegate. It seems my
system doesn't think that
System.Drawing.Image.GetThumbNailImageAbort exists.

Any ideas? I think I've been staring at the computer for too long and I'm
missing something obvious because there's nothing in Google about other
people having this problem, and I know I've had this sort of code working
before.

Thanks

Colin

Nov 16 '05 #4
I can not view the delegate in the object browser. I get an error message
that GetThumbnailImageAbort cannot be found, are you missing an assembly or
reference (or something to that effect).

It turns out that I can just pass null as the delegate in the
GetThumbnailImage method call and that works, but I'm a little concerned
about the missing delegate problem. I am using VS.Net 2003 on a fairly fresh
system (brand new install about a month ago, never had previous versions of
VS.Net installed).

Colin

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:fp**************@cpmsftngxa10.phx.gbl...
Hi Colin,

Based on my understanding, you want to use GetThumbnailImage method, but
your program can not find GetThumbNailImageAbort delegate.

I am not sure why your program can not find the GetThumbNailImageAbort
delegate. GetThumbNailImageAbort should be in the same namespace with the
GetThumbnailImage method, also, they both belong to Image class, this
problem should not happen.

What error message do you get? Can you view the GetThumbNailImageAbort
delegate from the "Object Browser"? Also, you may try to use ILdasm.exe to
view the content of this System.Drawing.dll assembly, if
GetThumbNailImageAbort existed.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #5
Thanks for the tip. I'll try that out. I haven't done a lot with images in
..Net, so I haven't come across that technique.

Colin

"Vijaye Raji" <no*************@hotmail.com> wrote in message
news:Od**************@TK2MSFTNGP09.phx.gbl...
The other issue aside, GetThumbNailImage is not a great way to resize
images. The method (as the name implies) is for creating thumbnails. If
you want to resize images, you should use the GDI+ call DrawImage on a
canvas that you created.

Pseudocode:

Bitmap bmp = new Bitmap(newWidth, newHeight);
Graphics gfx = Graphics.FromImage(bmp);
gfx.DrawImage(oldBitmap, 0, 0, newWidth, newHeight, 0, 0, oldWidth,
oldHeight);

-vJ

"Colin Young" <x@nospam.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
I'm trying to rezive an image using the GetThumbnailImage method, and I'm having some trouble with the GetThumbNailImageAbort delegate. It seems my system doesn't think that
System.Drawing.Image.GetThumbNailImageAbort exists.

Any ideas? I think I've been staring at the computer for too long and I'm missing something obvious because there's nothing in Google about other
people having this problem, and I know I've had this sort of code working before.

Thanks

Colin


Nov 16 '05 #6
Hi Colin,

Thanks for your feedback.

I think your problem is very strange. Have you add System.Drawing.dll as
reference? On my machine, when viewing System.Drawing namespace, I can view
GetThumbnailImageAbort method.

Have you tried to use "Find Symbol" button of "Object Browser"? Actually,
in "Object Browser", GetThumbnailImageAbort method is not in the subtree of
Image class, so you should determine if it existed through "Find Symbol".

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #7
Hi Colin,

Does my reply make sense to you? Have you resolved your problem?

Please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #8

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

Similar topics

2
by: Alex Hopson | last post by:
I'm using the code below to loop through some images and resize each image twice, once to create a thumbnail and once to create a small image. The page stops loading around the 38th image out of...
2
by: Anthony Williams | last post by:
Hi, I just updated the Ashwater website at http://www.ashwaterparish.org.uk to use CSS rather than frames/tables for layout. It works fine in NS7.1, Mozilla Firebird 0.6, IE6, Opera 5 and...
5
by: Jim | last post by:
I've heard that resizing images through PHP (either GD2 or ImageMagick) is a processor intensive exercise. I'm setting up a site where users will be uploading up to 10 images along with the details...
17
by: Sharon | last post by:
I Have a PC with dual XEON CPU’s and 4 Giga Byte RAM win Windows XP Pro. I have 2 problems with it: (1) Windows is showing only 3.25 Giga byte on the System Properties ? General tab. While the...
1
by: Ron Vecchi | last post by:
I am using asp.net to upload an image and then perform resizing on it and saving the different sizes to file. The resized images were coming up and being displayed in the bowser fine but the image...
10
by: David W. Simmonds | last post by:
I have a DataList control that has an Image control in the ItemTemplate. I would like to resize the image that goes into that control. I have a series of jpg files that are full size, full...
6
by: tomasio | last post by:
Dear NG, years have passed and I am still more designer than programmer. I build a new version of my website which has a few nasty bugs, especially on my startpage: Resizing text brakes the...
8
by: berkshire | last post by:
Hi, Anyone know of a script out there that can resize images and not sacrifice image quality? I've been using phpthumb (http://phpthumb.sourceforge.net/) but when compared to an image resized...
9
by: kombu67 | last post by:
I'm reading a series of images from a MS SQL table and saving them to directory. These are staff ID pictures from our security card app. Once I've extracted the ID photo from the security app to...
10
by: mishrarajesh44 | last post by:
hii all, I am facing a problem currently.. i have a script for image uploading and resizing.. the image uploading takes place properly for every size images.. but, the resizing works for...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.