我在我的monoandroid应用程序中使用 Cairo.Matrix dll 来加载一些System.Drawing.Drawing2D.Matix类方法它在构建时工作正常但在运行时从开罗的Matrix类.Matrix给出错误“System.NullReferenceException:对象引用未设置为对象的实例。” 当我初学Cairo.Matrix类错误“加载dicom filelibcairo-2.dll时出现异常。”
以下代码我正在尝试..........
using System;
using System.Drawing;
using Medsynaptic.Common;
using Medsynaptic.Imaging1.Mathematics;
**using Matrix = Cairo.Matrix;**
public class SpatialTransform : ISpatialTransform
{
private Cairo.Matrix _cumulativeTransform;
private Cairo.Matrix _transform;
public PointF ConvertToDestination(PointF sourcePoint)
{
double x = 0.0, y = 0.0;
this.CumulativeTransform.TransformPoint(ref x, ref y);
PointF point = new PointF((float)x, (float)y);
return point;
}
这里显示Null Ref Exception:对象引用未设置为对象的实例
public Cairo.Matrix CumulativeTransform
{
get
{
Calculate();
return _cumulativeTransform;
}
}
protected virtual void Calculate()
{
if (!this.RecalculationRequired)
return;
ERROR @ if condition: - 对象引用未设置为对象的实例
if (_cumulativeTransform == null)
_cumulativeTransform = new Cairo.Matrix();
// _cumulativeTransform.Reset();
_cumulativeTransform.InitIdentity();
}
}
这是android调试器显示输出错误错误加载 libcairo-2.dll
On Create Call
Picture box OnAttachedToWindow.
display.Height 430
firstRowHeight 43
pictureBox.DisplayHeight 301
Displaying image /mnt/sdcard/Images/Series1/1.2.840.113619.2.22.287.1.20040913.195606.dcm
Request garbage collector to initiate.
Presentation Image created.
Calling invalidate in Render Mode
Renderer will take care of it.
Calling DrawSceneGraph
Error In loading
libcairo-2.DLL
Picture box on draw called
Displayed medsynaptic.medsynapse/desktopexecutable.Activity1: +1m10s925ms
答案 0 :(得分:0)
不幸的是,包含Mono.Cairo.dll
是一个错误;它无法工作,因为它取决于Android没有提供的原生libcairo.so。 Mono.Cairo.dll
将在下一个版本中删除。