예제 #1
0
        public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
        {
            if (!IsPowered)
            {
                return;
            }

            base.PrepareFrame(frame, elapsedTime);
            var xScale = (float)Viewer.CabWidthPixels / 640;
            var yScale = (float)Viewer.CabHeightPixels / 480;

            DrawPosition.X      = (int)(Position.X * xScale) - Viewer.CabXOffsetPixels + Viewer.CabXLetterboxPixels;
            DrawPosition.Y      = (int)(Position.Y * yScale) + Viewer.CabYOffsetPixels + Viewer.CabYLetterboxPixels;
            DrawPosition.Width  = (int)(Control.Width * xScale);
            DrawPosition.Height = (int)(Control.Height * yScale);
            if (Zoomed)
            {
                DrawPosition.Width  = DMI.Width;
                DrawPosition.Height = DMI.Height;
                DMI.SizeTo(DrawPosition.Width, DrawPosition.Height);
                DrawPosition.X -= DMI.Width / 2;
                DrawPosition.Y -= DMI.Height / 2;
                DMI.ETCSDefaultWindow.BackgroundColor = ColorBackground;
            }
            else
            {
                DMI.SizeTo(DrawPosition.Width, DrawPosition.Height);
                DMI.ETCSDefaultWindow.BackgroundColor = Color.Transparent;
            }
            DMI.PrepareFrame(elapsedTime.ClockSeconds);
        }
예제 #2
0
 public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
 {
     base.PrepareFrame(frame, elapsedTime);
     DMI.SizeTo(DrawPosition.Width, DrawPosition.Height);
     DMI.ETCSDefaultWindow.BackgroundColor = Color.Transparent;
     DMI.PrepareFrame(elapsedTime.ClockSeconds);
 }