Exemple #1
0
        public SketchWindow(int width, int height)
            :base()
        {
            InitializeComponent();

            fBlackPen = new GDIPen(RGBColor.Black);

            this.Size = new System.Drawing.Size(width, height);
            this.Text = "Sketcher";
            this.AllowDrop = true;

            fPointList = new List<Point>();

            // Create the backing buffer to retain the image
            // Make it bigger than any likely displays
            backingBuffer = GDIDIBSection.Create(1600, 1200);
            GDIContext bufferContext = GDIContext.CreateForBitmap(backingBuffer);

            bufferContext.ClearToWhite();
            fBackingGraphPort = new GDIRenderer(bufferContext);

            fRetainedGraphPort = new GraphPortDelegate();
            fRetainedGraphPort.AddGraphPort(fBackingGraphPort);
            fRetainedGraphPort.AddGraphPort(GraphPort);

            CreateSession();

        }
Exemple #2
0
        protected UISurface(string title, int x, int y, int width, int height, Guid uniqueID)
        {
            fTitle = title;
            fFrame = new RECT(x, y, width, height);
            fBackingBuffer = new PixelBuffer(width, height);
            fGraphDelegate = new GraphPortDelegate();
            fGraphDelegate.AddGraphPort(fBackingBuffer.GraphPort);

            fUniqueID = uniqueID;

            UISurface.gSurfaces.Add(uniqueID, this);
        }
Exemple #3
0
        protected virtual void OnSurfaceCreated(Guid uniqueID)
        {
            fSurface = MetaSpace.GetSurface(uniqueID);

            fGraphDelegate = new GraphPortDelegate();
            fGraphDelegate.AddGraphPort(fSurface.GraphPort);

            AttachToUISurface();

            if (fIsVisible)
                fSurface.Show();
        }
Exemple #4
0
        public PassiveSpace(string title, RECT aframe)
            : base(title, aframe)
        {
            fBackingBuffer = new PixelBuffer(Frame.Width, aframe.Height);

            fWrappedGraphPort = new GraphPortDelegate();
            fWrappedGraphPort.AddGraphPort(fBackingBuffer.GraphPort);
            fWrappedGraphPort.AddGraphPort(base.GraphPort);

            // Add the channel for commands
            fSessionManager = new SessionManager();
            fControlChannel = new SpaceControlChannel(fSessionManager, fSessionManager.UniqueSessionName, this);
        }