Esempio n. 1
0
        public CollageEditState(DataAccess dataAccess)
        {
            this.dataAccess = dataAccess;

            // create CollageEditData. Inside you find all the information about the collage and how it is drawn
            CollageObject collage = new CollageObject();
            int width = dataAccess.GraphicsDevice.Viewport.Bounds.Width - 100;
            int height = (int)Math.Round(width / collage.AspectRatio);
            MoveableRectangle drawRectangle = new MoveableRectangle(new FloatRectangle(50, 50, width, height));
            UndoManager undoManager = new UndoManager();

            editData = new CollageEditData(collage, drawRectangle, undoManager);

            // create the Preview Renderer
            previewRenderer = new CollagePreviewRenderer(dataAccess);
            previewRenderer.SetEditData(editData);

            RegisterCollageOperators();

            // create activators
            activators = new List<IOperatorActivator>();
            activators.Add(new SpecialOperatorActivator(dataAccess, collageOperators));
            activators.Add(new KeymapActivator(dataAccess, collageOperators));
            activators.Add(new ToolbarActivator(dataAccess, collageOperators));
        }
Esempio n. 2
0
        public CollageEditData(CollageObject collage, MoveableRectangle drawRectangle, UndoManager undoManager)
        {
            this.collage = collage;
            this.drawRectangle = drawRectangle;
            this.undoManager = undoManager;

            selectedImages = new List<Image>();
        }