Loading JPEG to OxyImage
I have trouble loading JPEG images to OxyImage. I am using C# and WPF, OxyPlot version 2014.1.546.0 from NuGet. PNG and BMP images work great, but not JPEGs. I tried loading them using stream and bytearray
OxyImage image;Both without success (crashes on line with new OxyImage). I get this error message:
FileStream stream = new FileStream(filepath, FileMode.Open);
image = new OxyImage(stream);
OxyImage image1;
byte[] imageArray = File.ReadAllBytes(filepath);
image1 = new OxyImage(imageArray);
System.NotImplementedException was unhandled by user code HResult=-2147467263Can you give me some advice pleasse?
Message=The method or operation is not implemented.
Source=OxyPlot
StackTrace:
at OxyPlot.OxyImage.GetDecoder(ImageFormat format) in c:\projects\oxyplot\Source\OxyPlot\Imaging\OxyImage.cs:line 164
at OxyPlot.OxyImage.UpdateImageInfo() in c:\projects\oxyplot\Source\OxyPlot\Imaging\OxyImage.cs:line 260
at OxyPlot.OxyImage..ctor(Byte[] bytes) in c:\projects\oxyplot\Source\OxyPlot\Imaging\OxyImage.cs:line 48
at TemsaViewer01.PageXYGraph.LoadImages(Experiments exp) in d:\Cloud\VisualStudio\TemsaViewer01\TemsaViewer01\PageXYGraph.xaml.cs:line 101
at TemsaViewer01.PageXYGraph..ctor(Experiments exp) in d:\Cloud\VisualStudio\TemsaViewer01\TemsaViewer01\PageXYGraph.xaml.cs:line 53
at TemsaViewer01.MainWindow..ctor() in d:\Cloud\VisualStudio\TemsaViewer01\TemsaViewer01\MainWindow.xaml.cs:line 34
InnerException:
Oxplot not compatible with Caliburn.Micro + MEF
sharethl wrote at 2013-03-03 02:46:
It is oxyplot-94236a582857 on XP.
CM with customized bootstrapper cannot execute GetInstance() with OxyPlot.dll in its folder.
If OxyPlot.dll is removed, it works fine, also, no problem on Win7.
Here is the executes, not virus. You can remove OxyPlot.dll and see it works fine.
Environment: XP.
https://www.box.com/s/pk71tu3zj0r2j109j6xe
This is ex message
GetInstance
Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
protected override object GetInstance(Type serviceType, string key) {
try {
string contract = string.IsNullOrEmpty(key) ? AttributedModelServices.GetContractName(serviceType) : key;
var exports = container.GetExportedValues<object>(contract);
if (exports.Count() > 0)
return exports.First();
throw new Exception(string.Format("Could not locate any instances of contract {0}.", contract));
}
catch (Exception ex) {
using (StreamWriter writer = new StreamWriter("log.txt")) {
writer.WriteLine("GetInstance");
writer.WriteLine(ex.Message);
}
return null;
}
}
tibel wrote at 2013-03-03 17:54:
Using Portable Class Libraries - Update .NET Framework
As I don't get the exception on my machine.
sharethl wrote at 2013-03-03 22:48:
Thanks Tibel
Having ColumnSeries and a LineSeries within the same plot (CategoryAxis problem)
mezeizsolt wrote at 2013-03-21 14:17:
First of all I want to thank you for this great project, it saved me a lot of work already, its features are great!
I have run into a problem recently and I need some help: I have to show a ColumnSeries and a LineSeries on the same plot. The x-axis has to be time, and with the LineSeries out of the picture it works fine:
public class PlotData { public DateTime TimeOnX { get; set; } public double DataOnY { get; set; } public string LabelOnX { get { return this.TimeOnX.ToString("yyyy.mm.dd"); } } }
var plot = new PlotModel(); plot.Axes.Add(new CategoryAxis { ItemsSource = PlotDataItems, LabelField = "LabelOnX" }); plot.Axes.Add(new LinearAxis(AxisPosition.Left) { MinimumPadding = 0, AbsoluteMinimum = 0 }); plot.Series.Add(new ColumnSeries { ItemsSource = PlotDataItems, ValueField = "DataOnY" });
plot.Series.Add(new LineSeries { ItemsSource = PlotDataItems, DataFieldX = "TimeOnX", DataFieldY = "DataOnY" });
) I get a perfecly vertical line (every value is assigned to the "category of nothing").Then I figured out I have to set the ItemsSource of the CategoryAxis a collection of DateTime instead of PlotData:
plot.Axes.Add(new CategoryAxis { ItemsSource = PlotDataItems.Select(x => x.TimeOnX), Labels = PlotDataItems.Select(x => x.LabelOnX).ToList() });
As it turns out, LabelField property cannot be null, however I want to use the DateTime object itself, not its properties. (I am not quite sure how it supposed to work exactly, I could not find any details.)
Sorry, if I have overlooked something important.
Thank You,
Zsolt
RefreshPlot Removed
kevkon3 wrote at 2014-04-28 22:36:
Did we miss something in the changelog or documentation that points this out?
Either way, it would have been nice to mark the function as Obsolete and point us to the InvalidatePlot() method.
I am mainly posting this so that users who google the problem might get pointed to this discussion.
objo wrote at 2014-04-29 09:06:
Cross hair for tracking curves.
amity2001 wrote at 2012-07-18 09:12:
Hello World,
Having feature of Tracking curves with cross hair graphs is very common case.
Although the OxyPlot has feature of showing tooltip with point information while dragging mouse on the series, it is limited to single series only.
If user want to see values from different series at some point of X axis, then it is not possible with OxyPlot.
The requirement is,
The graph can have more than one series.
When user overs mouse on the graph, cross hair should appear and there should be option of showing values of every series at that point.
Kindly look at FLOT example.Please help to have this feature in WPF.
Thanks in advance.
objo wrote at 2012-08-08 23:42:
Showing the values after the series titles in the legend box is a nice feature! I will add it to the issue tracker - maybe there is an easy way to implement this. It should be generalized to support both horizontal and vertical tracker lines...
PS. I think a behaviour as in the FLOT example should be possible using a vertical line annotation and change the series titles on mouse events in the plot area...
Tracker vs. Annotation
TrickyT wrote at 2014-04-02 11:15:
In the "Getting Started"-example (http://www.oxyplot.org/doc/HelloWpf.html) a Function Series is introduced, and a Tracker is shown in the resulting plot when pressing the left mouse button.
Instead of a Function Series, I would like to draw some polygons with a Tracker attached. I tried to add a Polygon Annotation showing nice polygons in the plot, but no Tracker is shown when pressing the left mouse button. Do I have to implement the polygons using Series or is there another way of getting the Tracker together with annotations? Do I miss something?
objo wrote at 2014-04-02 12:14:
AreaSeries
is another alternative, but not as clean.Using a scrollbar ?!
_Noctis_ wrote at 2013-11-01 10:11:
Now, in OxyPlot, I can drag while holding the right mouse button, but I was wondering if it's possible to do the same with a scrollbar (the benefit is that the other Axis will stay fixed ... I guess we can achieve the same using : "IsZoomEnabled = false, IsPanEnabled = false", but i believe that having a scrollbar will be more intuitive, and you can start with a zoomed in and it'll be clear that there are move to the sides ...
objo wrote at 2013-11-06 23:18:
See the OverlayDemo in the WpfExamples. It is overlaying a Rectangle, but it could also be a scroll bar aligned at one of the axes!
This could be a nice example to add!
tibel wrote at 2014-03-27 21:42:
Can this be done with an
Annotaton
?One legend item for each group of LineSeries instances?
dcuccia wrote at 2014-03-25 22:05:
objo wrote at 2014-03-25 22:13:
Title
for only the first green LineSeries and the first blue LineSeries?dcuccia wrote at 2014-03-25 23:15:
did you try setting theThat's a swell idea - not sure why I didn't try that, just assumed it would be hard. Your framework is just too easy to use. ;) Works perfectly, thanks objo!Title
for only the first green LineSeries and the first blue LineSeries?
Error using toolbox with managed C++
AaronJohnson wrote at 2013-12-19 23:40:
---------------------------
Microsoft Visual Studio
---------------------------
Value does not fall within the expected range.
---------------------------
OK
---------------------------
Helpful, right?I am using the latest .NET 4.5 binaries. I added the plot control to the toolbox manually by browsing for OxyPlot.WindowsForms.DLL.
Any ideas? Is there any other information from me that would be helpful?
AaronJohnson wrote at 2013-12-20 16:16:
You have to manually set the project's targeted framework to version 4.5. You do this by manually editing the project file and adding <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> to the globals section.
Once you've done this, you'll actually be able to reference all of the required class libraries and the toolbox will now be usable.
DateTime Axes X: Majorstep (& majorGrid) in seconds, minorStep (&minorGrid) in milliseconds
JHN wrote at 2012-09-18 09:05:
Hi all,
First the code is in C#.
I tried hard to have an axe with the major step in seconds and minor step in milliseconds but I had no success!
I have values with: X = DateTime type and Y = Float type
The Gap between 2 values is 10 miliseconds.
I tried this:
DateTimeAxis axeX1 = new DateTimeAxis(); axeX1.MajorStep = (double)1/24/60/60; //1/24 = 1 hour, 1/24/60/60 = 1 second axeX1.MinorStep = axeX1.MajorStep/10; //1/10 10 miliseconds axeX1.StringFormat = "hh:mm:ss"; axeX1.ShowMinorTicks = true; axeX1.MajorGridlineColor = OxyColor.FromArgb(40, 255, 255, 255); axeX1.MajorGridlineStyle = LineStyle.Solid; axeX1.MinorGridlineColor = OxyColor.FromArgb(20, 255, 255, 255); axeX1.MinorGridlineStyle = LineStyle.Solid;
But between 2 major ticks I have a gap of 8 seconds and no minor tick between 2 major ticks.
Anyone has a solution or a way to follow for this kind of problem?
Thanks in advance.
JHN
cedrelo wrote at 2013-12-04 08:39:
Anyone to help ?
objo wrote at 2013-12-09 21:01:
https://oxyplot.codeplex.com/SourceControl/network/forks/mroth/oxyplot/contribution/5446
I am awaiting some unit tests/examples on this.
There are also some issues related to DateTimeAxis:
https://oxyplot.codeplex.com/workitem/10089
https://oxyplot.codeplex.com/workitem/10045
https://oxyplot.codeplex.com/workitem/7988
cedrelo wrote at 2013-12-10 14:31:
it's works with the fork
it would be great to include this in the main project
David_NET wrote at 2013-12-10 18:19:
Service d'assistance aux clients par UserEcho