Example #1
0
 /// <summary>
 /// Initializes a new instance of the VGRegion class.
 /// Clone Constructor. Creates new region element that is
 /// identical to the given VGRegion.
 /// </summary>
 /// <param name="regionToClone"><see cref="VGRegion"/> to clone</param>
 private VGRegion(VGRegion regionToClone)
     : base(
         regionToClone.ShapeDrawAction,
         regionToClone.Pen,
         regionToClone.Brush,
         regionToClone.Font,
         regionToClone.FontColor,
         regionToClone.Bounds,
         regionToClone.StyleGroup,
         regionToClone.Name,
         regionToClone.ElementGroup,
         regionToClone.Sound)
 {
     this.region   = (Region)regionToClone.Region.Clone();
     this.inverted = regionToClone.Inverted;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the VGRegion class.
 /// Clone Constructor. Creates new region element that is
 /// identical to the given VGRegion.
 /// </summary>
 /// <param name="regionToClone"><see cref="VGRegion"/> to clone</param>
 private VGRegion(VGRegion regionToClone)
   : base(
   regionToClone.ShapeDrawAction,
   regionToClone.Pen,
   regionToClone.Brush,
   regionToClone.Font,
   regionToClone.FontColor,
   regionToClone.Bounds,
   regionToClone.StyleGroup,
   regionToClone.Name,
   regionToClone.ElementGroup,
   regionToClone.Sound)
 {
   this.region = (Region)regionToClone.Region.Clone();
   this.inverted = regionToClone.Inverted;
 }
Example #3
0
    /// <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));
    }