Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a width and height to a bitmap in c#?

I have an image and I want to change the width & height of said image.

(For example Width = 200 Height = 120 and I want to change that to Width = 30 Height = 50)

What would be the best way to do so?

enter image description here

like image 297
amir Avatar asked Nov 01 '25 12:11

amir


1 Answers

Bitmap original = (Bitmap)Image.FromFile("DSC_0002.jpg");
Bitmap resized = new Bitmap(original,new Size(newWidth,newHeight));
like image 85
Master Programmer Avatar answered Nov 04 '25 03:11

Master Programmer