public Canvas(IntPtr context, IntPtr data) { Handle = NativeCD.cdCreateCanvasPtr(context, data); if (Handle == IntPtr.Zero) { throw new Exception("Failed to create canvas. Control mapped?"); } }