public void Resize(ZoomPercent aZoom) { MemoryStream stream = new MemoryStream(); this.Save(stream, BitmapType.Bmp1, false, aZoom); stream.Seek(0L, SeekOrigin.Begin); this.Load(stream, BitmapType.Bmp1, true); stream.Close(); }
internal static Bitmap GetThumbnailBmp(Bitmap fullSizeImage, ZoomPercent aZoomValue) { m_Zoom = aZoomValue; int height = fullSizeImage.Height; int width = fullSizeImage.Width; int aPreviewHeight = (int) (ZoomValue * height); int aPreviewWidth = (int) (ZoomValue * width); return GetThumbnailBmp(fullSizeImage, aPreviewWidth, aPreviewHeight); }
internal static Bitmap GetThumbnailBmp(Bitmap fullSizeImage, ZoomPercent aZoomValue) { m_Zoom = aZoomValue; int height = fullSizeImage.Height; int width = fullSizeImage.Width; int aPreviewHeight = (int)(ZoomValue * height); int aPreviewWidth = (int)(ZoomValue * width); return(GetThumbnailBmp(fullSizeImage, aPreviewWidth, aPreviewHeight)); }
public void Save(Stream stream, BitmapType type, bool withBorder, ZoomPercent aZoom) { Bitmap thumbnailBmp = GetThumbnail.GetThumbnailBmp(this.m_ImageDC, aZoom); this.Save(stream, type, withBorder, thumbnailBmp.Width, thumbnailBmp.Height, thumbnailBmp); }