/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the ColorDefinitionDialog class. /// Initializes components and gradients. /// </summary> /// <param name="drawingMode">The used <see cref="FixationDrawingMode"/> for the preview.</param> public ColorDefinitionDialog(FixationDrawingMode drawingMode) { this.InitializeComponent(); this.currentDrawingMode = drawingMode; this.InitializeGradients(); Ogama.Properties.Settings set = Properties.Settings.Default; this.selectedFont = (Font)set.GazeFixationsFont.Clone(); this.selectedFontColor = set.GazeFixationsFontColor; this.selectedFixationsPen = new Pen(set.GazeFixationsPenColor, set.GazeFixationsPenWidth); this.selectedFixationsPen.DashStyle = set.GazeFixationsPenStyle; this.selectedConnectionsPen = new Pen(set.GazeFixationConnectionsPenColor, set.GazeFixationConnectionsPenWidth); this.selectedFixationsPen.DashStyle = set.GazeFixationConnectionsPenStyle; }
/// <summary> /// Initializes standard graphic elements. /// </summary> private void InitializeElements() { if (Properties.Settings.Default != null) { Ogama.Properties.Settings set = Properties.Settings.Default; this.gazeFixationsPen = new Pen(set.GazeFixationsPenColor, set.GazeFixationsPenWidth); this.gazeFixationsPen.DashStyle = set.GazeFixationsPenStyle; this.gazeFixationConnectionsPen = new Pen(set.GazeFixationConnectionsPenColor, set.GazeFixationConnectionsPenWidth); this.gazeFixationConnectionsPen.DashStyle = set.GazeFixationConnectionsPenStyle; this.gazeFixationsFont = (Font)set.GazeFixationsFont.Clone(); this.gazeFixationsFontColor = set.GazeFixationsFontColor; this.gazeConnections = set.GazeConnections; this.gazeNumbers = set.GazeNumbers; this.mouseFixationsPen = new Pen(set.MouseFixationsPenColor, set.MouseFixationsPenWidth); this.mouseFixationsPen.DashStyle = set.MouseFixationsPenStyle; this.mouseFixationConnectionsPen = new Pen(set.MouseFixationsPenColor, set.MouseFixationsPenWidth); this.mouseFixationConnectionsPen.DashStyle = set.MouseFixationsPenStyle; this.mouseFixationsFont = (Font)set.MouseFixationsFont.Clone(); this.mouseFixationsFontColor = set.MouseFixationsFontColor; this.mouseConnections = set.MouseConnections; this.mouseNumbers = set.MouseNumbers; this.spotlightRegion = new VGRegion(ShapeDrawAction.Fill, this.GrayBrush); this.spotlightRegion.Inverted = true; this.gazeDrawingMode = (FixationDrawingMode)Enum.Parse(typeof(FixationDrawingMode), set.GazeFixationsDrawingMode); this.mouseDrawingMode = (FixationDrawingMode)Enum.Parse(typeof(FixationDrawingMode), set.MouseFixationsDrawingMode); } Bitmap colorMapBitmap = new Bitmap(AttentionMaps.NUMCOLORS, 1, PixelFormat.Format32bppArgb); // Cache the gradient by painting it onto a bitmap using (Graphics bitmapGraphics = Graphics.FromImage(colorMapBitmap)) { Rectangle bmpRct = new Rectangle(0, 0, colorMapBitmap.Width, colorMapBitmap.Height); AttentionMaps.Rainbow.PaintGradientWithDirectionOverride( bitmapGraphics, bmpRct, LinearGradientMode.Horizontal); } this.colorMap = new PaletteBitmap(colorMapBitmap); this.CreateHeatMapBitmap(new Size(100, 100)); }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the ColorDefinitionDialog class. /// Initializes components and gradients. /// </summary> /// <param name="drawingMode">The used <see cref="FixationDrawingMode"/> for the preview.</param> public ColorDefinitionDialog(FixationDrawingMode drawingMode) { this.InitializeComponent(); this.currentDrawingMode = drawingMode; this.InitializeGradients(); Ogama.Properties.Settings set = Properties.Settings.Default; this.selectedFont = (Font)set.GazeFixationsFont.Clone(); this.selectedFontColor = set.GazeFixationsFontColor; this.selectedFixationsPen = new Pen(set.GazeFixationsPenColor, set.GazeFixationsPenWidth); this.selectedFixationsPen.DashStyle = set.GazeFixationsPenStyle; this.selectedConnectionsPen = new Pen(set.GazeFixationConnectionsPenColor, set.GazeFixationConnectionsPenWidth); this.selectedFixationsPen.DashStyle = set.GazeFixationConnectionsPenStyle; }