Image.GetThumbnailImage 方法
2006-11-02 09:00
411 查看
Image.GetThumbnailImage 方法
返回此 Image 对象的缩略图。[Visual Basic] Public Function GetThumbnailImage( _ ByVal thumbWidth As Integer, _ ByVal thumbHeight As Integer, _ ByVal callback As Image.GetThumbnailImageAbort, _ ByVal callbackData As IntPtr _ ) As Image [C#] public Image GetThumbnailImage( intthumbWidth, intthumbHeight, Image.GetThumbnailImageAbortcallback, IntPtrcallbackData ); [C++] public: Image* GetThumbnailImage( intthumbWidth, intthumbHeight, Image.GetThumbnailImageAbort* callback, IntPtrcallbackData ); [JScript] public function GetThumbnailImage( thumbWidth : int, thumbHeight : int, callback : Image.GetThumbnailImageAbort, callbackData : IntPtr ) : Image;
参数
thumbWidth 请求的缩略图的宽度(以像素为单位)。 thumbHeight 请求的缩略图的高度(以像素为单位)。 callback 一个 Image.GetThumbnailImageAbort 委托。在 GDI+ 1.0 版中不使用此委托。即便如此,也必须创建一个委托并在该参数中传递对此委托的引用。 callbackData 必须是 IntPtr.Zero。返回值
用于表示该缩略图的 Image 对象。备注
如果 Image 对象包含一个嵌入式缩略图像,则此方法会检索嵌入式缩略图,并将其缩放为所需大小。如果 Image 对象不包含嵌入式缩略图像,此方法会通过缩放主图像创建一个缩略图像。当所请求的缩略图大小约为 120×120 时,GetThumbnailImage 工作正常。如果从一个有嵌入式缩略图的 Image 对象中请求一个较大的缩略图像(比如 300×300),则在缩略图像的质量会有显著的降低。通过调用 DrawImage 缩放主图像(而非嵌入式缩略图),则效果可能较好。
示例
[C#] 下面的示例创建并显示一个缩略图图像。从不调用此委托。[C#] public bool ThumbnailCallback() { return false; } public void Example_GetThumb(PaintEventArgs e) { Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback); Bitmap myBitmap = new Bitmap("Climber.jpg"); Image myThumbnail = myBitmap.GetThumbnailImage( 40, 40, myCallback, IntPtr.Zero); e.Graphics.DrawImage(myThumbnail, 150, 75); }
相关文章推荐
- 使用Image.GetThumbnailImage 方法返回缩略图
- 使用Image.GetThumbnailImage 方法返回缩略图
- Image image = Toolkit.getDefaultToolkit().getImage("picture/bg.jpg");// 这种图片加载方法为什么要 先最小化窗口然后才会显示
- 解决方法!:getImageData on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.
- 4.5.1_利用getImageData()与putImageData()方法来实现橡皮筋式选取框_改良版
- AndroidGUI29:用getDrawingCache方法获取ImageView中的图像需要注意的问题
- 使用GetThumbnailImage进行图片缩放操作
- 利用canvas的getImageData()方法制作《在线取色器》
- 使用GetThumbnailImage进行图片缩放操作
- Android开发:用getDrawingCache方法获取ImageView中的图像需要注意的问题
- 关于.net中获取图像缩略图的函数GetThumbnailImage的一些认识。
- android 中遇到 imageView getWidth 始终为0 时 ,设置 setImageBitmap 的方法
- Android开发:用getDrawingCache方法获取ImageView中的图像需要注意的问题 本篇文章来源于 Linux公社网站(www.linuxidc.com) 原文链接:http:/
- android 中遇到 imageView getWidth 始终为0 时 ,设置 setImageBitmap 的方法
- getDrawingCache方法获取ImageView中的图像需要注意的问题
- 使用GetThumbnailImage进行图片缩放操作
- canvas图像滤镜---canvas getImageData() 方法
- PHP函数getimagesize的具体使用方法
- 4.5.1_利用getImageData()与putImageData()方法来实现橡皮筋式选取框
- .net中获取图像缩略图的函数GetThumbnailImage