|
BitmapExtensionsResize(Image, Size) Method
|
Returns a resized Bitmap image of the original.
Namespace: GSF.DrawingAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.253-beta+ffb7163c9e3b771705bc5b9aa3f09870f2cb9e2c
Syntaxpublic static Bitmap Resize(
this Image originalImage,
Size newSize
)
<ExtensionAttribute>
Public Shared Function Resize (
originalImage As Image,
newSize As Size
) As Bitmap
public:
[ExtensionAttribute]
static Bitmap^ Resize(
Image^ originalImage,
Size newSize
)
[<ExtensionAttribute>]
static member Resize :
originalImage : Image *
newSize : Size -> Bitmap
GSF.Drawing.BitmapExtensions.Resize = function(originalImage, newSize);
View SourceParameters
- originalImage Image
- The original Bitmap image to be resized.
- newSize Size
- The Size to which the original image is to be resized.
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:
using System;
using GSF.Drawing;
using System.Drawing;
class Program
{
static void Main(string[] args)
{
Bitmap original = (Bitmap)Bitmap.FromFile("Original.jpg");
Bitmap originalResized = original.Resize(new Size(800, 600));
originalResized.Save("OriginalResized.jpg");
original.Dispose();
originalResized.Dispose();
Console.ReadLine();
}
}
See Also