| ofs | hex dump | ascii |
|---|
| 0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 04 3d 00 00 02 c8 08 06 00 00 00 7c 7b 8b | .PNG........IHDR...=.........|{. |
| 0020 | e8 00 00 00 01 73 52 47 42 00 ae ce 1c e9 00 00 00 04 67 41 4d 41 00 00 b1 8f 0b fc 61 05 00 00 | .....sRGB.........gAMA......a... |
| 0040 | 00 09 70 48 59 73 00 00 0e c3 00 00 0e c3 01 c7 6f a8 64 00 00 00 18 74 45 58 74 53 6f 66 74 77 | ..pHYs..........o.d....tEXtSoftw |
| 0060 | 61 72 65 00 70 61 69 6e 74 2e 6e 65 74 20 34 2e 30 2e 39 6c 33 7e 4e 00 00 ff 81 49 44 41 54 78 | are.paint.net.4.0.9l3~N....IDATx |
| 0080 | 5e ec fd 0b f0 25 67 7a de 87 8d 13 72 99 58 66 a4 98 5c 4a 32 43 5a 52 64 89 92 48 8a 97 dd e5 | ^....%gz....r.Xf..\J2CZRd..H.... |
| 00a0 | 6d 49 49 94 44 49 36 53 b2 ab 52 2a 59 b2 75 49 4a b2 14 59 72 54 ba c5 0b 2c 15 45 76 ec c4 2e | mII.DI6S..R*Y.uIJ..YrT...,.Ev... |
| 00c0 | 57 e2 c8 72 25 b6 93 2a 9b 8c 68 96 a8 24 8a 2a fe f3 a2 5d 2c b0 58 dc 2f 33 c0 dc 07 0b 2c 30 | W..r%..*..h..$.*...],.X./3....,0 |
| 00e0 | 00 66 31 18 ec 0d c0 2e 06 18 4c be a7 f7 3c ff 79 fe ef bc 5f 77 9f 3e 7d ce e9 ee f3 4c d5 af | .f1.......L...<.y..._w.>}....L.. |
| 0100 | fa fd de f7 fd be af cf f9 f7 39 a7 df 67 be ee 3e 75 74 74 64 fa f3 cf 18 63 8c 31 c6 18 63 8c | ..........9..g..>uttd....c.1..c. |
| 0120 | 31 7b 24 ab 55 4d 85 d4 69 d2 03 6b 5d fe 7b c6 18 63 8c 31 c6 18 63 cc 1a 64 b5 e5 3a 64 f5 ed | 1{$.UM..i..k].{..c.1..c..d..:d.. |
| 0140 | 41 93 3a 0f 90 ec 60 e9 43 76 90 fe f7 8d 31 c6 18 63 8c 31 c6 98 81 64 75 26 c8 6a d2 36 b2 da | A.:...`.Cv....1..c.1...du&.j.6.. |
| 0160 | f7 e0 48 9d 07 40 3c 10 b4 ad f0 e0 ca 0e 44 f0 0d c2 37 1a 63 8c 31 c6 18 63 8c 31 23 a1 f5 26 | ..H..@<.......D...7.c.1..c.1#..& |
| 0180 | 88 f5 68 97 18 92 d5 ba 5a 17 1f 04 a9 f3 00 88 7f 78 50 13 38 32 41 e3 9b 02 ff 83 15 ff 43 63 | ..h.....Z........xP.82A.......Cc |
| 01a0 | 8c 31 c6 18 63 8c 31 66 43 58 63 c6 da f3 03 05 using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace RealTimeGraphEx.Components
{
public class YAxisWave : YAxisScroll
{
private Grid innerGrid;
public YAxisWave()
: base()
{
}
public override void Render(RealTimeGraphExBase graph, bool animate = false)
{
if (graph == null) return;
if (innerGrid == null)
{
innerGrid = new Grid();
}
if (Interval == 0) return;
if (Interval % 2 != 0) Interval += 1;
var grid = innerGrid;
var renderBounds = Graph.GetGraphRenderBounds();
double animationTime = animate ? 0.2 : 0;
DoubleAnimation heightAnimation = new DoubleAnimation() { Duration = new Duration(TimeSpan.FromSeconds(animationTime)) };
heightAnimation.To = double.IsNaN(Graph.gridLinesAndImageWrapperGrid.Height) ? Graph.gridLinesAndImageWrapperGrid.ActualHeight : Graph.gridLinesAndImageWrapperGrid.Height;
if (!double.IsNaN(grid.Height))
{
grid.BeginAnimation(Grid.HeightProperty, heightAnimation);
}
else
{
grid.Height = Graph.gridLinesAndImageWrapperGrid.ActualHeight;
}
grid.VerticalAlignment = System.Windows.VerticalAlignment.Top;
ThicknessAnimation marginAni = new ThicknessAnimation() { Duration = new Duration(TimeSpan.FromSeconds(animationTime)) };
marginAni.To = new Thickness(0, Graph.gridLinesAndImageWrapperGrid.Margin.Top, 0, 0);
if (!double.IsNaN(grid.Height))
{
grid.BeginAnimation(MarginProperty, marginAni);
}
else
{
grid.Margin = new Thickness(0, Graph.gridLinesAndImageWrapperGrid.Margin.Top, 0, 0);
}
this.ClipToBounds = true;
this.Content = grid;
double height = double.IsNaN(Graph.gridLinesAndImageWrapperGrid.Height) ? Graph.gridLinesAndImageWrapperGrid.ActualHeight : Graph.gridLinesAndImageWrapperGrid.Height;
int interval = (int)Math.Round((Interval * (((height * 100) / Graph.gridMain.ActualHeight) / 100)), MidpointRounding.ToEven);
grid.RowDefinitions.Clear();
grid.Children.Clear();
for (int i = 0; i < interval; i++)
{
RowDefinition rowLabels = new RowDefinition();
rowLabels.Height = new GridLength(1, GridUnitType.Star);
grid.RowDefinitions.Add(rowLabels);
}
for (int i = 0; i < interval; i++)
{
AddLabel(Math.Abs((graph.Maximum - (i * ((graph.Maximum + Math.Abs(graph.Minimum)) / (interval / 2))))).ToString(StringFormat), graph, grid, i, System.Windows.VerticalAlignment.Top);
}
AddLabel(graph.Maximum.ToString(StringFormat), graph, grid, interval - 1, System.Windows.VerticalAlignment.Bottom);
}
protected override void OnGraphZoomComplete(Point transformOrigin, double scaleX, double scaleY)
{
Render(Graph, true);
}
protected override void OnGraphPanningComplete(Point translate)
{
if (innerGrid != null)
{
var renderBounds = Graph.GetGraphRenderBounds();
innerGrid.BeginAnimation(MarginProperty, null);
innerGrid.Margin = new Thickness(0, renderBounds.Top, 0, 0);
}
}
}
}
|