public DrawingGenericPosture(Guid toolId, PointF origin, GenericPosture posture, long timestamp, long averageTimeStampsPerFrame, DrawingStyle stylePreset)
        {
            this.toolId         = toolId;
            this.origin         = origin;
            this.genericPosture = posture;
            if (genericPosture != null)
            {
                Init();
            }

            // Decoration and binding to mini editors.
            styleHelper.Bicolor = new Bicolor(Color.Empty);
            styleHelper.Font    = new Font("Arial", 12, FontStyle.Bold);

            if (stylePreset == null)
            {
                stylePreset = new DrawingStyle();
                stylePreset.Elements.Add("line color", new StyleElementColor(Color.DarkOliveGreen));
            }

            style = stylePreset.Clone();
            BindStyle();

            // Fading
            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            menuFlipHorizontal.Click += menuFlipHorizontal_Click;
            menuFlipHorizontal.Image  = Properties.Drawings.fliphorizontal;
            menuFlipVertical.Click   += menuFlipVertical_Click;
            menuFlipVertical.Image    = Properties.Drawings.flipvertical;
        }
Example #2
0
 private void ImportPreferences()
 {
     drawOnPlay    = PreferencesManager.PlayerPreferences.DrawOnPlay;
     defaultFading = new InfosFading(0, 0);
     //defaultFading = PreferencesManager.PlayerPreferences.DefaultFading;
     trackingProfile = PreferencesManager.PlayerPreferences.TrackingProfile;
 }
Example #3
0
        public DrawingAngle(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null)
        {
            int length = 50;

            if (transformer != null)
            {
                length = transformer.Untransform(50);
            }

            points.Add("o", origin);
            points.Add("a", origin.Translate(0, -length));
            points.Add("b", origin.Translate(length, 0));

            styleHelper.Bicolor = new Bicolor(Color.Empty);
            styleHelper.Font    = new Font("Arial", 12, FontStyle.Bold);

            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Angle");
            }

            style = preset.Clone();
            BindStyle();

            // Fading
            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            mnuInvertAngle.Click += mnuInvertAngle_Click;
            mnuInvertAngle.Image  = Properties.Drawings.angleinvert;
        }
Example #4
0
        public DrawingChrono(PointF p, long start, long averageTimeStampsPerFrame, DrawingStyle preset = null)
        {
            // Core
            visibleTimestamp       = start;
            startCountingTimestamp = long.MaxValue;
            stopCountingTimestamp  = long.MaxValue;
            invisibleTimestamp     = long.MaxValue;
            countdown = false;
            mainBackground.Rectangle = new RectangleF(p, SizeF.Empty);

            timecode = "error";

            styleHelper.Bicolor = new Bicolor(Color.Black);
            styleHelper.Font    = new Font("Arial", 16, FontStyle.Bold);

            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Chrono");
            }

            style = preset.Clone();
            BindStyle();

            label     = "";
            showLabel = true;

            // We use the InfosFading utility to fade the chrono away.
            // The refererence frame will be the frame at which fading start.
            // Must be updated on "Hide" menu.
            infosFading = new InfosFading(invisibleTimestamp, averageTimeStampsPerFrame);
            infosFading.FadingFrames = allowedFramesOver;
            infosFading.UseDefault   = false;
        }
Example #5
0
        public DrawingText(int x, int y, int width, int height, long _iTimestamp, long _iAverageTimeStampsPerFrame)
        {
            m_Text                = "";          //KTS 04MAY2019 Changed from " " to "" to eliminate extra space at start of each line.
            m_TextboxColor        = Color.White; // Color.LightSteelBlue;
            m_BackgroundRectangle = new Rectangle(x, y, width, height);
            m_TextStyle           = new InfosTextDecoration("Arial", m_iDefaultFontSize, FontStyle.Bold, Color.White, Color.CornflowerBlue);

            m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);
            m_bEditMode   = false;

            // Textbox initialization.
            m_TextBox              = new TextBox();
            m_TextBox.Visible      = false;
            m_TextBox.BackColor    = m_TextboxColor;
            m_TextBox.BorderStyle  = BorderStyle.None;
            m_TextBox.Text         = m_Text;
            m_TextBox.Font         = m_TextStyle.GetInternalFont();
            m_TextBox.Multiline    = true;
            m_TextBox.TextChanged += new EventHandler(TextBox_TextChanged);


            m_fStretchFactor    = 1.0;
            m_DirectZoomTopLeft = new Point(0, 0);
            RescaleCoordinates(m_fStretchFactor, m_DirectZoomTopLeft);
        }
Example #6
0
        public DrawingLine(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null)
        {
            points["a"] = origin;
            points["b"] = origin.Translate(10, 0);
            miniLabel.SetAttach(GetMiddlePoint(), true);

            styleHelper.Color         = Color.DarkSlateGray;
            styleHelper.LineSize      = 1;
            styleHelper.LineShape     = LineShape.Solid;
            styleHelper.LineEnding    = LineEnding.None;
            styleHelper.ValueChanged += StyleHelper_ValueChanged;
            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Line");
            }

            style = preset.Clone();
            BindStyle();

            // Fading
            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            // Context menu
            ReinitializeMenu();
            mnuCalibrate.Click += mnuCalibrate_Click;
            mnuCalibrate.Image  = Properties.Drawings.linecalibrate;
        }
Example #7
0
        //------------------------------------------------------
        // Note:
        // When using the planar calibration, the projection of the circle in world space and back in image space
        // creates an ellipse whose center is not exactly on the center of the original circle.
        // This is why there are extra checks to move the minilabel attachment point everytime the drawing moves,
        // changes size, or when the calibration changes.
        //------------------------------------------------------

        #region Constructor
        public DrawingCircle(PointF center, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null)
        {
            this.center = center;
            miniLabel.SetAttach(center, true);

            if (transformer != null)
            {
                this.radius = transformer.Untransform(25);
            }

            this.radius      = Math.Min(radius, 10);
            this.infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            styleHelper.Color         = Color.Empty;
            styleHelper.LineSize      = 1;
            styleHelper.PenShape      = PenShape.Solid;
            styleHelper.ValueChanged += StyleHelper_ValueChanged;
            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Circle");
            }

            style = preset.Clone();
            BindStyle();

            ReinitializeMenu();
        }
Example #8
0
        public DrawingPolyline(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null)
        {
            points["0"] = origin;
            points["1"] = origin;

            styleHelper.Color    = Color.DarkSlateGray;
            styleHelper.LineSize = 1;

            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Polyline");
            }

            style = preset.Clone();
            BindStyle();

            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            mnuFinish.Click        += mnuFinish_Click;
            mnuAddThenFinish.Click += mnuAddThenFinish_Click;
            mnuCloseMenu.Click     += mnuCloseMenu_Click;

            mnuFinish.Image        = Properties.Drawings.tick_small;
            mnuAddThenFinish.Image = Properties.Drawings.plus_small;
            mnuCloseMenu.Image     = Properties.Drawings.cross_small;
        }
Example #9
0
        private void Initialize(int _iWidth, int _iHeight, long _iTimestamp, long _iAverageTimeStampsPerFrame)
        {
            m_iOriginalWidth  = m_Bitmap.Width;
            m_iOriginalHeight = m_Bitmap.Height;

            // Set the initial scale so that the drawing is some part of the image height, to make sure it fits well.
            // For bitmap drawing, we only do this if no upsizing is involved.
            m_fInitialScale = (float)(((float)_iHeight * 0.75) / m_iOriginalHeight);
            if (m_fInitialScale < 1.0)
            {
                m_iOriginalWidth  = (int)((float)m_iOriginalWidth * m_fInitialScale);
                m_iOriginalHeight = (int)((float)m_iOriginalHeight * m_fInitialScale);
            }

            m_BoundingBox.Rectangle = new Rectangle((_iWidth - m_iOriginalWidth) / 2, (_iHeight - m_iOriginalHeight) / 2, m_iOriginalWidth, m_iOriginalHeight);

            // Fading
            m_InfosFading               = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);
            m_InfosFading.UseDefault    = false;
            m_InfosFading.AlwaysVisible = true;

            // This is used to set the opacity factor.
            m_FadingColorMatrix.Matrix00 = 1.0f;
            m_FadingColorMatrix.Matrix11 = 1.0f;
            m_FadingColorMatrix.Matrix22 = 1.0f;
            m_FadingColorMatrix.Matrix33 = 1.0f;                // Change alpha value here for fading. (i.e: 0.5f).
            m_FadingColorMatrix.Matrix44 = 1.0f;
            m_FadingImgAttr.SetColorMatrix(m_FadingColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);

            PreferencesManager pm = PreferencesManager.Instance();

            m_PenBoundingBox           = new Pen(Color.White, 1);
            m_PenBoundingBox.DashStyle = DashStyle.Dash;
            m_BrushBoundingBox         = new SolidBrush(m_PenBoundingBox.Color);
        }
Example #10
0
        public DrawingChrono(Point p, long start, long _AverageTimeStampsPerFrame, DrawingStyle _preset)
        {
            // Core
            m_iVisibleTimestamp       = start;
            m_iStartCountingTimestamp = long.MaxValue;
            m_iStopCountingTimestamp  = long.MaxValue;
            m_iInvisibleTimestamp     = long.MaxValue;
            m_bCountdown = false;
            m_MainBackground.Rectangle = new Rectangle(p, Size.Empty);

            m_Timecode = "error";

            m_StyleHelper.Bicolor = new Bicolor(Color.Black);
            m_StyleHelper.Font    = new Font("Arial", 16, FontStyle.Bold);
            if (_preset != null)
            {
                m_Style = _preset.Clone();
                BindStyle();
            }

            m_Label      = "";
            m_bShowLabel = true;

            // We use the InfosFading utility to fade the chrono away.
            // The refererence frame will be the frame at which fading start.
            // Must be updated on "Hide" menu.
            m_InfosFading = new InfosFading(m_iInvisibleTimestamp, _AverageTimeStampsPerFrame);
            m_InfosFading.FadingFrames = m_iAllowedFramesOver;
            m_InfosFading.UseDefault   = false;
        }
Example #11
0
        public DrawingLine(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null)
        {
            points["a"]  = origin;
            points["b"]  = origin.Translate(10, 0);
            labelMeasure = new KeyframeLabel(GetMiddlePoint(), Color.Black, transformer);

            styleHelper.Color    = Color.DarkSlateGray;
            styleHelper.LineSize = 1;

            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Line");
            }

            style = preset.Clone();
            BindStyle();

            // Fading
            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            // Context menu
            mnuShowMeasure.Click += mnuShowMeasure_Click;
            mnuShowMeasure.Image  = Properties.Drawings.measure;
            mnuSealMeasure.Click += mnuSealMeasure_Click;
            mnuSealMeasure.Image  = Properties.Drawings.linecalibrate;
        }
Example #12
0
        public DrawingText(PointF p, long timestamp, long averageTimeStampsPerFrame, DrawingStyle stylePreset)
        {
            text = " ";
            background.Rectangle = new RectangleF(p, SizeF.Empty);

            styleHelper.Bicolor = new Bicolor(Color.Black);
            styleHelper.Font    = new Font("Arial", defaultFontSize, FontStyle.Bold);

            if (stylePreset != null)
            {
                style = stylePreset.Clone();
                BindStyle();
            }

            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);
            editing     = false;

            textBox = new TextBox()
            {
                Visible     = false,
                BackColor   = Color.White,
                BorderStyle = BorderStyle.None,
                Multiline   = true,
                Text        = text,
                Font        = styleHelper.GetFontDefaultSize(defaultFontSize)
            };

            textBox.TextChanged += TextBox_TextChanged;
            UpdateLabelRectangle();
        }
Example #13
0
        public DrawingText(Point p, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _preset)
        {
            m_Text = " ";
            m_Background.Rectangle = new Rectangle(p, Size.Empty);

            // Decoration & binding with editors
            m_StyleHelper.Bicolor = new Bicolor(Color.Black);
            m_StyleHelper.Font    = new Font("Arial", m_iDefaultFontSize, FontStyle.Bold);
            if (_preset != null)
            {
                m_Style = _preset.Clone();
                BindStyle();
            }

            m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);
            m_bEditMode   = false;

            m_TextBox = new TextBox()
            {
                Visible     = false,
                BackColor   = Color.White,
                BorderStyle = BorderStyle.None,
                Multiline   = true,
                Text        = m_Text,
                Font        = m_StyleHelper.GetFontDefaultSize(m_iDefaultFontSize)
            };

            m_TextBox.TextChanged += new EventHandler(TextBox_TextChanged);

            UpdateLabelRectangle();
        }
Example #14
0
        public DrawingAngle(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null)
        {
            int length = 50;

            if (transformer != null)
            {
                length = transformer.Untransform(50);
            }

            points.Add("o", origin);
            points.Add("a", origin.Translate(length, 0));
            points.Add("b", origin.Translate(0, -length));

            styleHelper.Bicolor = new Bicolor(Color.Empty);
            styleHelper.Font    = new Font("Arial", 12, FontStyle.Bold);

            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Angle");
            }

            style = preset.Clone();
            BindStyle();

            // Fading
            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            mnuSignedAngle.Click         += mnuSignedAngle_Click;
            mnuSignedAngle.Checked        = signedAngle;
            mnuCounterClockwise.Click    += mnuCounterClockwise_Click;
            mnuCounterClockwise.Checked   = counterClockwise;
            mnuSupplementaryAngle.Click  += mnuSupplementaryAngle_Click;
            mnuSupplementaryAngle.Checked = supplementaryAngle;
        }
Example #15
0
        public DrawingPlane(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null)
        {
            // Decoration
            styleHelper.Color         = Color.Empty;
            styleHelper.GridDivisions = 8;
            styleHelper.Perspective   = true;
            styleHelper.ValueChanged += StyleHelper_ValueChanged;
            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Plane");
            }

            style = preset.Clone();
            BindStyle();

            infosFading               = new InfosFading(timestamp, averageTimeStampsPerFrame);
            infosFading.UseDefault    = false;
            infosFading.AlwaysVisible = true;

            planeWidth  = 100;
            planeHeight = 100;
            quadPlane   = new QuadrilateralF(planeWidth, planeHeight);

            mnuCalibrate.Click += new EventHandler(mnuCalibrate_Click);
            mnuCalibrate.Image  = Properties.Drawings.linecalibrate;
        }
Example #16
0
 private void ImportPreferences()
 {
     drawOnPlay             = PreferencesManager.PlayerPreferences.DrawOnPlay;
     enableFiltering        = PreferencesManager.PlayerPreferences.EnableFiltering;
     enableCustomToolsDebug = PreferencesManager.PlayerPreferences.EnableCustomToolsDebugMode;
     defaultFading          = new InfosFading(0, 0);
     trackingProfile        = PreferencesManager.PlayerPreferences.TrackingProfile;
 }
Example #17
0
        public AutoNumber(XmlReader xmlReader, PointF scale, TimestampMapper timestampMapper, Metadata metadata)
            : this(0, 0, Point.Empty, 0)
        {
            ReadXml(xmlReader, scale, timestampMapper);

            infosFading              = new InfosFading(position, metadata.AverageTimeStampsPerFrame);
            infosFading.UseDefault   = false;
            infosFading.FadingFrames = 25;
        }
Example #18
0
 public Spotlight(long position, long averageTimeStampsPerFrame, PointF center)
 {
     this.position            = position;
     points["o"]              = center;
     radius                   = minimalRadius;
     infosFading              = new InfosFading(position, averageTimeStampsPerFrame);
     infosFading.UseDefault   = false;
     infosFading.FadingFrames = 25;
 }
Example #19
0
        public FormConfigureVisibility(AbstractDrawing drawing, Control screen)
        {
            this.drawing       = drawing;
            this.surfaceScreen = screen;
            this.memoFading    = drawing.InfosFading.Clone();

            InitializeComponent();
            Populate();
        }
Example #20
0
        public AutoNumber(long position, long averageTimeStampsPerFrame, PointF location, int value)
        {
            this.position        = position;
            background.Rectangle = new RectangleF(location, SizeF.Empty);
            this.value           = value;

            infosFading              = new InfosFading(position, averageTimeStampsPerFrame);
            infosFading.UseDefault   = false;
            infosFading.FadingFrames = 25;
        }
Example #21
0
        private InfosFading m_MemoInfosFading;     // Memo to fallback to on cancel.
        #endregion

        #region Construction & Initialization
        public formConfigureOpacity(AbstractDrawing _drawing, PictureBox _SurfaceScreen)
        {
            m_SurfaceScreen   = _SurfaceScreen;
            m_Drawing         = _drawing;
            m_MemoInfosFading = _drawing.InfosFading.Clone();

            InitializeComponent();
            ConfigureForm();
            LocalizeForm();
        }
Example #22
0
        public DrawingSVG(int _iWidth, int _iHeight, long _iTimestamp, long _iAverageTimeStampsPerFrame, string _filename)
        {
            // Init and import an SVG.
            m_Renderer.BackColor = Color.Transparent;

            // Rendering window. The width and height will be updated later.
            m_SvgWindow = new SvgWindow(100, 100, m_Renderer);

            // FIXME: some files have external DTD that will be attempted to be loaded.
            // See files created from Amaya for example.
            m_SvgWindow.Src = _filename;
            m_bLoaded       = true;

            if (m_SvgWindow.Document.RootElement.Width.BaseVal.UnitType == SvgLengthType.Percentage)
            {
                m_bSizeInPercentage = true;
                m_iOriginalWidth    = (int)(m_SvgWindow.Document.RootElement.ViewBox.BaseVal.Width * (m_SvgWindow.Document.RootElement.Width.BaseVal.Value / 100));
                m_iOriginalHeight   = (int)(m_SvgWindow.Document.RootElement.ViewBox.BaseVal.Height * (m_SvgWindow.Document.RootElement.Height.BaseVal.Value / 100));
            }
            else
            {
                m_bSizeInPercentage = false;
                m_iOriginalWidth    = (int)m_SvgWindow.Document.RootElement.Width.BaseVal.Value;
                m_iOriginalHeight   = (int)m_SvgWindow.Document.RootElement.Height.BaseVal.Value;
            }

            // Set the initial scale so that the drawing is some part of the image height, to make sure it fits well.
            m_fInitialScale   = (float)(((float)_iHeight * 0.75) / m_iOriginalHeight);
            m_iOriginalWidth  = (int)((float)m_iOriginalWidth * m_fInitialScale);
            m_iOriginalHeight = (int)((float)m_iOriginalHeight * m_fInitialScale);

            m_BoundingBox.Rectangle = new Rectangle((_iWidth - m_iOriginalWidth) / 2, (_iHeight - m_iOriginalHeight) / 2, m_iOriginalWidth, m_iOriginalHeight);

            // Render on first draw call.
            m_bFinishedResizing = true;

            // Fading
            m_InfosFading               = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);
            m_InfosFading.UseDefault    = false;
            m_InfosFading.AlwaysVisible = true;

            // This is used to set the opacity factor.
            m_FadingColorMatrix.Matrix00 = 1.0f;
            m_FadingColorMatrix.Matrix11 = 1.0f;
            m_FadingColorMatrix.Matrix22 = 1.0f;
            m_FadingColorMatrix.Matrix33 = 1.0f;                // Change alpha value here for fading. (i.e: 0.5f).
            m_FadingColorMatrix.Matrix44 = 1.0f;
            m_FadingImgAttr.SetColorMatrix(m_FadingColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);

            PreferencesManager pm = PreferencesManager.Instance();

            m_PenBoundingBox           = new Pen(Color.White, 1);
            m_PenBoundingBox.DashStyle = DashStyle.Dash;
            m_BrushBoundingBox         = new SolidBrush(m_PenBoundingBox.Color);
        }
Example #23
0
        public DrawingChrono(PointF p, long start, long averageTimeStampsPerFrame, DrawingStyle preset = null)
        {
            // Core
            visibleTimestamp         = 0;
            startCountingTimestamp   = long.MaxValue;
            stopCountingTimestamp    = long.MaxValue;
            invisibleTimestamp       = long.MaxValue;
            clockOriginTimestamp     = long.MaxValue;
            mainBackground.Rectangle = new RectangleF(p, SizeF.Empty);

            timecode = "error";

            styleHelper.Bicolor = new Bicolor(Color.Black);
            styleHelper.Font    = new Font("Arial", 16, FontStyle.Bold);
            styleHelper.Clock   = false;
            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Chrono");
            }

            style = preset.Clone();
            BindStyle();

            label     = "";
            showLabel = true;

            // We use the InfosFading utility to fade the chrono away.
            // The refererence frame will be the frame at which fading start.
            // Must be updated on "Hide" menu.
            infosFading = new InfosFading(invisibleTimestamp, averageTimeStampsPerFrame);
            infosFading.FadingFrames = allowedFramesOver;
            infosFading.UseDefault   = false;

            mnuVisibility.Image  = Properties.Drawings.persistence;
            mnuShowBefore.Image  = Properties.Drawings.showbefore;
            mnuShowAfter.Image   = Properties.Drawings.showafter;
            mnuHideBefore.Image  = Properties.Drawings.hidebefore;
            mnuHideAfter.Image   = Properties.Drawings.hideafter;
            mnuShowBefore.Click += MnuShowBefore_Click;
            mnuShowAfter.Click  += MnuShowAfter_Click;
            mnuHideBefore.Click += MnuHideBefore_Click;
            mnuHideAfter.Click  += MnuHideAfter_Click;
            mnuVisibility.DropDownItems.AddRange(new ToolStripItem[] { mnuShowBefore, mnuShowAfter, new ToolStripSeparator(), mnuHideBefore, mnuHideAfter });

            mnuStart.Image       = Properties.Drawings.chronostart;
            mnuStop.Image        = Properties.Drawings.chronostop;
            mnuMarkOrigin.Image  = Properties.Resources.marker;
            mnuStart.Click      += mnuStart_Click;
            mnuStop.Click       += mnuStop_Click;
            mnuMarkOrigin.Click += mnuMarkOrigin_Click;
        }
Example #24
0
        public DrawingPencil(Point _origin, Point _second, long _iTimestamp, long _AverageTimeStampsPerFrame, DrawingStyle _preset)
        {
            m_PointList.Add(_origin);
            m_PointList.Add(_second);
            m_InfosFading = new InfosFading(_iTimestamp, _AverageTimeStampsPerFrame);

            m_StyleHelper.Color    = Color.Black;
            m_StyleHelper.LineSize = 1;
            if (_preset != null)
            {
                m_Style = _preset.Clone();
                BindStyle();
            }
        }
Example #25
0
        public DrawingCircle(Point _center, int radius, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _preset)
        {
            m_Center      = _center;
            m_iRadius     = Math.Min(radius, 10);
            m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);

            m_StyleHelper.Color    = Color.Empty;
            m_StyleHelper.LineSize = 1;
            if (_preset != null)
            {
                m_Style = _preset.Clone();
                BindStyle();
            }
        }
Example #26
0
        public DrawingCross2D(int x, int y, long _iTimestamp, long _iAverageTimeStampsPerFrame)
        {
            // Position
            m_CenterPoint       = new Point(x, y);
            m_fStretchFactor    = 1.0;
            m_DirectZoomTopLeft = new Point(0, 0);

            // Decoration
            m_PenStyle    = new LineStyle(1, LineShape.Simple, Color.CornflowerBlue);
            m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);

            // Computed
            RescaleCoordinates(m_fStretchFactor, m_DirectZoomTopLeft);
        }
Example #27
0
        public DrawingPencil(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null)
        {
            pointList.Add(origin);
            pointList.Add(origin.Translate(1, 0));
            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            styleHelper.Color    = Color.Black;
            styleHelper.LineSize = 1;
            if (preset != null)
            {
                style = preset.Clone();
                BindStyle();
            }
        }
Example #28
0
        public DrawingSVG(int x, int y, long _iTimestamp, long _iAverageTimeStampsPerFrame, string _filename)
        {
            m_fStretchFactor    = 1.0;
            m_DirectZoomTopLeft = new Point(0, 0);

            //----------------------------
            // Init and import an SVG.
            // Testing code. Should load a file according to a parameter.
            //----------------------------
            m_Renderer.BackColor = Color.Transparent;

            // Rendering window. The width and height will be updated later.
            m_SvgWindow = new SvgWindow(100, 100, m_Renderer);

            // FIXME: some files have external DTD that will be attempted to be loaded.
            // See files created from Amaya for example.
            m_SvgWindow.Src = _filename;
            m_bLoaded       = true;

            m_iOriginalWidth          = (int)m_SvgWindow.Document.RootElement.Width.BaseVal.Value;
            m_iOriginalHeight         = (int)m_SvgWindow.Document.RootElement.Height.BaseVal.Value;
            m_fOriginalAspectRatio    = (double)m_iOriginalWidth / (double)m_iOriginalHeight;
            m_UnscaledRenderingWindow = new Rectangle(x - m_iOriginalWidth / 2, y - m_iOriginalHeight / 2, m_iOriginalWidth, m_iOriginalHeight);

            // Everything start unscaled.
            RescaleCoordinates(m_fStretchFactor, m_DirectZoomTopLeft);

            // Render on first draw call.
            m_bFinishedResizing = true;

            // Fading
            m_InfosFading               = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);
            m_InfosFading.UseDefault    = false;
            m_InfosFading.AlwaysVisible = true;

            // This is kept in place but in the current implementation the drawing never fade. (motion guide).
            m_FadingColorMatrix.Matrix00 = 1.0f;
            m_FadingColorMatrix.Matrix11 = 1.0f;
            m_FadingColorMatrix.Matrix22 = 1.0f;
            m_FadingColorMatrix.Matrix33 = 1.0f;                // Change alpha value here for fading. (i.e: 0.5f).
            m_FadingColorMatrix.Matrix44 = 1.0f;
            m_FadingImgAttr.SetColorMatrix(m_FadingColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);

            PreferencesManager pm = PreferencesManager.Instance();

            m_PenBoundingBox           = new Pen(Color.FromArgb(255, pm.GridColor.R, pm.GridColor.G, pm.GridColor.B), 1);
            m_PenBoundingBox.DashStyle = DashStyle.Dash;
            m_BrushBoundingBox         = new SolidBrush(m_PenBoundingBox.Color);
        }
Example #29
0
        public DrawingRectangle(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null)
        {
            quadImage = new QuadrilateralF(origin, origin.Translate(50, 0), origin.Translate(50, 50), origin.Translate(0, 50));

            styleHelper.Color    = Color.Empty;
            styleHelper.LineSize = 1;
            styleHelper.PenShape = PenShape.Solid;
            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Rectangle");
            }

            style = preset.Clone();
            BindStyle();

            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);
        }
        public DrawingDistortionGrid(PointF point, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null)
        {
            styleHelper.Color = Color.Empty;
            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("DistortionGrid");
            }

            style = preset.Clone();
            BindStyle();

            infosFading               = new InfosFading(timestamp, averageTimeStampsPerFrame);
            infosFading.UseDefault    = true;
            infosFading.AlwaysVisible = false;

            mnuCalibrate.Click += new EventHandler(mnuCalibrate_Click);
            mnuCalibrate.Image  = Properties.Drawings.linecalibrate;
        }