Add extension methods for bitmap GetSize and GetRect

This commit is contained in:
Flamefire committed 2014-09-22 16:27:00 +02:00
1 parent 016b7627d1
commit d1e9fbaff1
5 files changed
+23 -10

No files matched your search

+11
View File
@@ -17,6 +17,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Linq;
@@ -134,5 +135,15 @@ namespace VocaluxeLib
rect.H + 2 * rect.H * (scale - 1f),
rect.Z);
}
public static Size GetSize(this Bitmap bmp)
{
return new Size(bmp.Width, bmp.Height);
}
public static Rectangle GetRect(this Bitmap bmp)
{
return new Rectangle(0, 0, bmp.Width, bmp.Height);
}
}
}