New Icons and Zoom of graph were added
This commit is contained in:
@@ -19,7 +19,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
|
||||
public StrainTuple GetSofteningFactors()
|
||||
{
|
||||
var strainTuple = new StrainTuple();
|
||||
var loaderStainMatrix = StrainTupleService.ConvertToLoaderStrainMatrix(StrainTuple);
|
||||
var loaderStainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(StrainTuple);
|
||||
var (MxFactor, MyFactor, NzFactor) = GeometryOperations.GetSofteningsFactors(NdmCollection, loaderStainMatrix);
|
||||
strainTuple.Mx = MxFactor;
|
||||
strainTuple.My = MyFactor;
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses
|
||||
{
|
||||
public class ExportFrameWorkElementLogic : IExportResultLogic
|
||||
{
|
||||
private FrameworkElement visual;
|
||||
public string FileName { get; set; }
|
||||
|
||||
public void Export()
|
||||
{
|
||||
var encoder = new PngBitmapEncoder();
|
||||
EncodeVisual(visual, FileName, encoder);
|
||||
}
|
||||
|
||||
public ExportFrameWorkElementLogic(FrameworkElement visual)
|
||||
{
|
||||
this.visual = visual;
|
||||
}
|
||||
|
||||
private static void EncodeVisual(FrameworkElement visual, string fileName, BitmapEncoder encoder)
|
||||
{
|
||||
var bitmap = new RenderTargetBitmap((int)visual.ActualWidth, (int)visual.ActualHeight, 96, 96, PixelFormats.Pbgra32);
|
||||
|
||||
bitmap.Render(visual);
|
||||
var frame = BitmapFrame.Create(bitmap);
|
||||
encoder.Frames.Add(frame);
|
||||
using (var stream = File.Create(fileName)) encoder.Save(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user