1
2
3
4
5
6
7
8
|
string BildName = @"C:\TestBild.jpeg";
double GewuenschteBildHoehe = 600.0;
System.Drawing.Image OriginalBild = new System.Drawing.Bitmap(BildName, true);
double Faktor = GewuenschteBildHoehe / (double)OriginalBild.Height;
int Breite = Convert.ToInt32(Faktor * (double)OriginalBild.Width);
System.Drawing.Image Angepasst = new System.Drawing.Bitmap(OriginalBild, Breite, Convert.ToInt32(GewuenschteBildHoehe));
Angepasst.Save(BildName);
|