コード例 #1
0
        public override void GetImage(ViewObject obj, Graphics grap)
        {
            CoupleDouble point = obj.Pos * scale + offset;
            CoupleDouble size  = obj.Size * scale;

            Bitmap   ship         = new Bitmap(32, 32);
            Graphics shipGraphics = Graphics.FromImage(ship);

            Rectangle shipRectangle = new Rectangle(0, 0, 32, 32);

            string name  = obj.Name;
            Image  image = null;

            _sourcesList.Images.TryGetValue(name, out image);

            Brush shipBrush = null != image? new TextureBrush(image) : Brushes.Black;

            shipGraphics.FillRectangle(shipBrush, shipRectangle);

            grap.DrawImage(ship, RotatingRectangle.GetPoints(point, size, obj.RotateAngle));
        }
コード例 #2
0
 private void DrawLaserBullet(CoupleDouble pos, CoupleDouble size, Degree angle, Graphics e)
 {
     e.FillPolygon(Brushes.Red, RotatingRectangle.GetPoligon(pos, size, angle));
 }