Пример #1
0
        /// <summary>
        /// Draws an icon on the target unscaled but centered at the given scene coordinates.
        /// </summary>
        /// <param name="target"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="imageData"></param>
        protected override void DrawIcon(Target2DWrapper <global::Android.Graphics.Canvas> target, double x, double y,
                                         byte[] imageData)
        {
            global::Android.Graphics.Bitmap image = global::Android.Graphics.BitmapFactory.DecodeByteArray(
                imageData, 0, imageData.Length);

            double[] transformed = this.Transform(x, y);

            target.Target.DrawBitmap(image, (float)transformed [0], (float)transformed [1], null);
            image.Dispose();
        }
Пример #2
0
        /// <summary>
        /// Draws an icon on the target unscaled but centered at the given scene coordinates.
        /// </summary>
        /// <param name="target"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="imageData"></param>
        protected override void DrawIcon(Target2DWrapper <global::Android.Graphics.Canvas> target, double x, double y,
                                         byte[] imageData)
        {
            global::Android.Graphics.Bitmap image = global::Android.Graphics.BitmapFactory.DecodeByteArray(
                imageData, 0, imageData.Length);

//			// calculate target rectangle.
//			double sceneSizeX = this.FromPixels(target, _view, image.Width) / 2.0f;
//			double sceneSizeY = this.FromPixels(target, _view, image.Height) / 2.0f;
//			double sceneTop = x + sceneSizeX;
//			double sceneBottom = x - sceneSizeX;
//			double sceneLeft = y - sceneSizeY;
//			double sceneRight = y + sceneSizeY;

            double[] transformed = this.Tranform(x, y);

            target.Target.DrawBitmap(image, (float)transformed [0], (float)transformed [1], null);
            image.Dispose();
        }