Files
StructureHelper/StructureHelperLogics/NdmCalculations/Analyses/ExportResultToBitmapLogic.cs
2025-10-29 22:07:41 +05:00

28 lines
773 B
C#

using StructureHelperCommon.Services.Exports;
using System.Windows.Media.Imaging;
namespace StructureHelperLogics.NdmCalculations.Analyses
{
public class ExportResultToBitmapLogic : IExportResultLogic
{
private BitmapImage bitmapImage;
public ExportResultToBitmapLogic(BitmapImage bitmapImage)
{
this.bitmapImage = bitmapImage;
}
public string FileName { get; set; }
public void Export()
{
using (var fileStream = new FileStream(FileName, FileMode.Create))
{
BitmapEncoder encoder = new BmpBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bitmapImage));
encoder.Save(fileStream);
}
}
}
}