Skip to content

Commit e6d8921

Browse files
C# and Java error reporting
1 parent 6b28d0c commit e6d8921

File tree

5 files changed

+567
-129
lines changed

5 files changed

+567
-129
lines changed

CS/Example2.cs

+10-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
public class Example2{
55

66
public static void Main2(){
7+
boolean success;
78
RGBABitmapImageReference imageReference = CreateRGBABitmapImageReference();
9+
StringReference errorMessage = new StringReference;
810

911
ScatterPlotSeries series = GetDefaultScatterPlotSeriesSettings();
1012
series.xs = new double [] {-2, -1, 0, 1, 2};
@@ -24,10 +26,14 @@ public static void Main2(){
2426
settings.yLabel = "Y axis".ToCharArray();
2527
settings.scatterPlotSeries = new ScatterPlotSeries [] {series};
2628

27-
DrawScatterPlotFromSettings(imageReference, settings);
29+
success = DrawScatterPlotFromSettings(imageReference, settings, errorMessage);
2830

29-
double[] pngdata = ConvertToPNG(imageReference.image);
30-
WriteToFile(pngdata, "example2.png");
31-
DeleteImage(imageReference.image);
31+
if(success){
32+
double[] pngdata = ConvertToPNG(imageReference.image);
33+
WriteToFile(pngdata, "example2.png");
34+
DeleteImage(imageReference.image);
35+
}else{
36+
Console.Error(errorMessage.string);
37+
}
3238
}
3339
}

0 commit comments

Comments
 (0)