public CustomNativeGraphicsView(Context context, IDrawable drawable = null) : base(context) { _scale = Resources.DisplayMetrics.Density; _canvas = new NativeCanvas(context); _scalingCanvas = new ScalingCanvas(_canvas); Drawable = drawable; }
protected override void OnClosing(CancelEventArgs e) { //close native windows if (nativeCanvas != null) { nativeCanvas.Dispose(); nativeCanvas = null; } base.OnClosing(e); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); NativePixelLibInterOp.LoadLib(); nativeCanvas = NativeCanvas.CreateNativeCanvas(this.Handle, 800, 600); Bitmap bmp = new Bitmap("res_fish.bmp"); nativeBmp = NativeBmp.CreateNativeWrapper(bmp); isReady = true; }
internal Canvas(NativeCanvas native) { mNativeCanvas = native; mDensity = android.util.DisplayMetrics.DENSITY_DEFAULT; }