Esempio n. 1
0
        public SaliencyMap(GraphicalAnswerLayer answerLayer, double width, double height, int clusterSize = 50)
        {
            ISaliencyMap map = new MySaliencyMap((int) width, (int) height, clusterSize);
            foreach (var point in answerLayer.SaliencyMap.Points)
            {
                map.AddPoint((int) point.X, (int) point.Y);
            }
            map.Build();

            Source = map.GetGraphic(32).ToBitmapSourceBis(); // Fix High-Dpi screen issue
            IsAnswered = ((ExerciseContent) answerLayer.Content).HasBeenCollected;
        }
Esempio n. 2
0
 public void AddNewAnswerLayer(int offset, GraphicalAnswerLayer answerLayer)
 {
     var layerViewModel = new Layer(this, lessonModel, answerLayer);
     Layers.Add(new KeyValuePair<int, Layer>(offset, layerViewModel));
     CurrentLayerIndex = Layers.Count - 1; // Select the last Layer (which is the Answer Layer)
     CurrentLayer.DisplaySaliencyMap(); // Compile SaliencyMap for the Layer
 }
Esempio n. 3
0
 /// <summary>
 ///     Adds the answer layer, default is graphical answer layer
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="src">The source.</param>
 /// <returns></returns>
 public virtual int AddAnswerLayer(string name, bool isRenameable = false, bool isHideable = true,
     bool isDeletable = false, bool isShareable = false, bool isInkable = true)
 {
     var layer = new GraphicalAnswerLayer(this, name,
         (Processing as GraphicalProcessing).GetResults() as Collection<Point>, isRenameable, isHideable,
         isDeletable, isShareable, isInkable);
     Layers.Add(layer);
     AnswerLayer = layer;
     return layer.UID;
 }