예제 #1
0
 private static void nativeDraw(android.graphics.Canvas.NativeCanvas canvas_instance
                                , android.graphics.Rect loc, android.graphics.Bitmap.NativeBitmap bitmap_instance
                                , byte[] c, android.graphics.Paint.NativePaint paint_instance_or_null, int destDensity
                                , int srcDensity)
 {
     System.IntPtr         loc_ptr  = System.IntPtr.Zero;
     Sharpen.INativeHandle c_handle = null;
     try
     {
         loc_ptr  = android.graphics.Rect.Rect_Helper.ManagedToNative(loc);
         c_handle = XobotOS.Runtime.MarshalGlue.Array_byte_Helper.GetPinnedPtr(c);
         libxobotos_NinePatch_drawI(canvas_instance, loc_ptr, bitmap_instance, c_handle.Address
                                    , paint_instance_or_null != null ? paint_instance_or_null : android.graphics.Paint.NativePaint
                                    .Zero, destDensity, srcDensity);
         android.graphics.Rect.Rect_Helper.MarshalOut(loc_ptr, loc);
     }
     finally
     {
         android.graphics.Rect.Rect_Helper.FreeManagedPtr(loc_ptr);
         if (c_handle != null)
         {
             c_handle.Free();
         }
     }
 }
예제 #2
0
 private static void nativeAddLayer(android.graphics.Rasterizer.NativeRasterizer native_layer
                                    , android.graphics.Paint.NativePaint native_paint, float dx, float dy)
 {
     libxobotos_LayerRasterizer_LayerRasterizer_addLayer(native_layer, native_paint, dx
                                                         , dy);
 }
예제 #3
0
파일: Paint.cs 프로젝트: hakeemsm/XobotOS
		/// <summary>
		/// Create a new paint, initialized with the attributes in the specified
		/// paint parameter.
		/// </summary>
		/// <remarks>
		/// Create a new paint, initialized with the attributes in the specified
		/// paint parameter.
		/// </remarks>
		/// <param name="paint">
		/// Existing paint used to initialized the attributes of the
		/// new paint.
		/// </param>
		public Paint(android.graphics.Paint paint)
		{
			mNativePaint = native_initWithPaint(paint.mNativePaint);
			setClassVariablesFrom(paint);
		}
예제 #4
0
 private static extern void libxobotos_NinePatch_drawI(android.graphics.Canvas.NativeCanvas
                                                       canvas_instance, System.IntPtr loc, android.graphics.Bitmap.NativeBitmap bitmap_instance
                                                       , System.IntPtr c, android.graphics.Paint.NativePaint paint_instance_or_null, int
                                                       destDensity, int srcDensity);
예제 #5
0
파일: Paint.cs 프로젝트: hakeemsm/XobotOS
		/// <summary>Create a new paint with the specified flags.</summary>
		/// <remarks>
		/// Create a new paint with the specified flags. Use setFlags() to change
		/// these after the paint is created.
		/// </remarks>
		/// <param name="flags">initial flag bits, as if they were passed via setFlags().</param>
		public Paint(int flags)
		{
			// we use this when we first create a paint
			mNativePaint = native_init();
			setFlags(flags | DEFAULT_PAINT_FLAGS);
			// TODO: Turning off hinting has undesirable side effects, we need to
			//       revisit hinting once we add support for subpixel positioning
			// setHinting(DisplayMetrics.DENSITY_DEVICE >= DisplayMetrics.DENSITY_TV
			//        ? HINTING_OFF : HINTING_ON);
			mCompatScaling = mInvCompatScaling = 1;
		}