|
@@ -12,6 +12,13 @@ namespace MvvmScaffoldFrame48.DLL.ImageAlgorithm
|
|
|
{
|
|
{
|
|
|
public static class ImageAlgorithmTools
|
|
public static class ImageAlgorithmTools
|
|
|
{
|
|
{
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 根据ROI裁剪图像
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="sourceBitmap"></param>
|
|
|
|
|
+ /// <param name="roi"></param>
|
|
|
|
|
+ /// <returns></returns>
|
|
|
|
|
+ /// <exception cref="ArgumentException"></exception>
|
|
|
public static Bitmap CropBitmap(Bitmap sourceBitmap, Rectangle roi)
|
|
public static Bitmap CropBitmap(Bitmap sourceBitmap, Rectangle roi)
|
|
|
{
|
|
{
|
|
|
// 检查边界
|
|
// 检查边界
|
|
@@ -69,7 +76,11 @@ namespace MvvmScaffoldFrame48.DLL.ImageAlgorithm
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Bitmap 转 BitmapImage 的辅助方法
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Bitmap 转 BitmapImage 的辅助方法
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="bitmap"></param>
|
|
|
|
|
+ /// <returns></returns>
|
|
|
public static BitmapImage ConvertToBitmapImage(Bitmap bitmap)
|
|
public static BitmapImage ConvertToBitmapImage(Bitmap bitmap)
|
|
|
{
|
|
{
|
|
|
using (MemoryStream memory = new MemoryStream())
|
|
using (MemoryStream memory = new MemoryStream())
|