Exemplo n.º 1
0
        public void drawImage(Image argImage, Point location, int rotation)
        {
            // make sure rotation is in the range 0...359
            rotation = normalizeRotation(rotation);

            Size      imageSize = CoordinateTranslator.sceneToScreenSize(argImage.Size, renderSurface.Size);
            Rectangle imageRect = new Rectangle(new Point(-(imageSize.Width / 2), -(imageSize.Height / 2)), imageSize);

            int x = location.X + (imageSize.Width / 2);
            int y = location.Y + (imageSize.Height / 2);

            // move and rotate canvas
            prepareCanvasOrientation(rotation, x, y);
            // draw
            myBuffer.Graphics.DrawImage(argImage, imageRect);
            // reset canvas
            resetCanvasOrientation(rotation, x, y);
        }
Exemplo n.º 2
0
 public Size translateSizeToResolution(Size size)
 {
     return(CoordinateTranslator.sceneToScreenSize(size, renderSurface.Size));
 }