c# - How can i resize an image? -


this question has answer here:

i have code:

public static bitmap resizeimage(bitmap imgtoresize, size size)         {             try             {                 bitmap b = new bitmap(size.width, size.height);                 using (graphics g = graphics.fromimage((image)b))                 {                     g.interpolationmode = system.drawing.drawing2d.interpolationmode.highqualitybicubic;                      g.drawimage(imgtoresize, 0, 0, size.width, size.height);                 }                  return b;             }             catch             {                 throw;             }         } 

when call function example : resizeimage(bmp, how set size ?

in example:

resizeimage(bmp, new size(150, 150)); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -