c# resize bitmap
//Size of "testimage.bmp" file is 1024x1024.
Bitmap bmp = (Bitmap)Bitmap.FromFile(@"C:\testimage.bmp");
Bitmap newImage = ResizeBitmap(bmp, 512, 512);
public Bitmap ResizeBitmap(Bitmap bmp, int width, int height)
{
Bitmap result = new Bitmap(width, height);
using (Graphics g = Graphics.FromImage(result))
{
g.DrawImage(bmp, 0, 0, width, height);
}
return result;
}
Also in C#:
- list c#
- c# try catch error
- unity find object by name
- regex replace all special characters
- mongodb custom IIdGenerator
- how to say or in c#
- c# new thread
- how to get length of okobjectresult c#
- unity reset scene
- c# list all files in a directory and subdirectory
- move file from one folder to another c#
- get random number c#
- unitt only 1 number float
- convert array object to int[] c#
- unity rigidbody constraints
- c# pass mouse events to parent
- .netstandard distinctby iqueryable
- asp.net mvc return file
- c# implement ienumerable t
- accessing form controls from another class c#
- c# return multiple value unity
- c# one line set
- isdaylightsavingtime in c#
- c# anonymous class