|
BitmapExtensionsResize(Image, Size, Boolean) Method
|
Returns a resized
Bitmap image of the original.
Namespace: GSF.DrawingAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax GSF.Drawing.BitmapExtensions.Resize = function(originalImage, newSize, disposeOriginal);
View SourceParameters
- originalImage Image
- The original Bitmap image to be resized.
- newSize Size
- The Size to which the original image is to be resized.
- disposeOriginal Boolean
- true if the original image is to be disposed after resizing it; otherwise false.
Return Value
BitmapA
Bitmap instance.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Image. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Example
This example shows how to resize an image and dispose the original image that was resized:
using System;
using System.Drawing;
using GSF.Drawing;
class Program
{
static void Main(string[] args)
{
using (Bitmap resized = ((Bitmap)Bitmap.FromFile("Original.jpg")).Resize(new Size(800, 600), true))
{
resized.Save("OriginalResized.jpg");
}
Console.ReadLine();
}
}
See Also