예제 #1
0
        public void Connect(LayoutFarm.UI.UISurfaceViewportControl vwport)
        {
#if DEBUG
            this.vwport = vwport;
#endif
            this.TopMost = true;
        }
예제 #2
0
 public static void MakeFormCanvas(Form form1, LayoutFarm.UI.UISurfaceViewportControl surfaceViewportControl)
 {
     form1.FormClosing += (s, e) =>
     {
         surfaceViewportControl.Close();
     };
 }
예제 #3
0
        public void Connect(LayoutFarm.UI.UISurfaceViewportControl vwport)
        {
#if DEBUG
            this.vwport = vwport;
#endif
            this.TopMost = true;
        }
예제 #4
0
 public static Form CreateNewFormCanvas(
     int w, int h,
     InnerViewportKind internalViewportKind,
     out LayoutFarm.UI.UISurfaceViewportControl canvasViewport)
 {
     return(CreateNewFormCanvas(0, 0, w, h, internalViewportKind, out canvasViewport));
 }
예제 #5
0
        public static Form CreateNewFormCanvas(
            MyRootGraphic myRootGfx,
            InnerViewportKind internalViewportKind,
            out LayoutFarm.UI.UISurfaceViewportControl canvasViewport)
        {
            Form      form1                = new Form();
            var       innerViewport        = canvasViewport = new LayoutFarm.UI.UISurfaceViewportControl();
            Rectangle screenClientAreaRect = Conv.ToRect(Screen.PrimaryScreen.WorkingArea);

            canvasViewport.InitRootGraphics(myRootGfx, myRootGfx.TopWinEventPortal, internalViewportKind);
            canvasViewport.Bounds =
                new System.Drawing.Rectangle(0, 0,
                                             screenClientAreaRect.Width,
                                             screenClientAreaRect.Height);
            //----------------------
            form1.Controls.Add(canvasViewport);
            //----------------------
            MakeFormCanvas(form1, canvasViewport);

            form1.SizeChanged += (s, e) =>
            {
                if (form1.WindowState == FormWindowState.Maximized)
                {
                    Screen currentScreen = GetScreenFromX(form1.Left);
                    //make full screen ?
                    if (innerViewport != null)
                    {
                        innerViewport.Size = currentScreen.WorkingArea.Size;
                    }
                }
            };
            //----------------------
            return(form1);
        }
예제 #6
0
        public static void CreateConvasControlOnExistingControl(
            Control landingControl,
            int xpos, int ypos,
            int w, int h,
            InnerViewportKind internalViewportKind,
            out LayoutFarm.UI.UISurfaceViewportControl canvasViewport)
        {
            //1. init
            InitWinform();
            IFontLoader fontLoader = s_fontstore;

            //2.
            PixelFarm.Drawing.ITextService ifont = null;
            switch (internalViewportKind)
            {
            default:
                ifont = PixelFarm.Drawing.WinGdi.WinGdiPlusPlatform.GetIFonts();
                //ifont = new OpenFontTextService();
                break;

            case InnerViewportKind.GL:
                ifont = new OpenFontTextService();
                break;
            }

            PixelFarm.Drawing.WinGdi.WinGdiPlusPlatform.SetFontLoader(fontLoader);

            //

            //---------------------------------------------------------------------------

            MyRootGraphic myRootGfx = new MyRootGraphic(
                w, h,
                ifont
                );

            //---------------------------------------------------------------------------

            var       innerViewport        = canvasViewport = new LayoutFarm.UI.UISurfaceViewportControl();
            Rectangle screenClientAreaRect = Conv.ToRect(Screen.PrimaryScreen.WorkingArea);

            canvasViewport.InitRootGraphics(myRootGfx, myRootGfx.TopWinEventPortal, internalViewportKind);
            canvasViewport.Bounds =
                new System.Drawing.Rectangle(xpos, ypos,
                                             screenClientAreaRect.Width,
                                             screenClientAreaRect.Height);

            landingControl.Controls.Add(canvasViewport);
            //
            Form ownerForm = landingControl.FindForm();

            if (ownerForm != null)
            {
                ownerForm.FormClosing += (s, e) =>
                {
                    innerViewport.Close();
                };
            }
        }
예제 #7
0
        public SampleViewport(LayoutFarm.UI.UISurfaceViewportControl vw)
        {
            this.vw = vw;
            var workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;

            this.primaryScreenWorkingAreaW = workingArea.Width;
            this.primaryScreenWorkingAreaH = workingArea.Height;
        }
예제 #8
0
        public SampleViewport(LayoutFarm.UI.UISurfaceViewportControl vw)
        {
            this.vw = vw;
            var workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;
            this.primaryScreenWorkingAreaW = workingArea.Width;
            this.primaryScreenWorkingAreaH = workingArea.Height;

        }
예제 #9
0
        public SampleViewport(LayoutFarm.UI.UISurfaceViewportControl vw)
        {
            this.vw = vw;
            var workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;

            this.primaryScreenWorkingAreaW = workingArea.Width;
            this.primaryScreenWorkingAreaH = workingArea.Height;

            //--------------
            imageContentMan = new ImageContentManager(vw.Platform);
            imageContentMan.ImageLoadingRequest += (s, e) =>
            {
                e.SetResultImage(LoadBitmap(e.ImagSource));
            };
        }
예제 #10
0
        public static Form CreateNewFormCanvas(
            MyRootGraphic myRootGfx,
            InnerViewportKind internalViewportKind,
            out LayoutFarm.UI.UISurfaceViewportControl canvasViewport)
        {


            Form form1 = new Form();
            var innerViewport = canvasViewport = new LayoutFarm.UI.UISurfaceViewportControl();
            Rectangle screenClientAreaRect = Conv.ToRect(Screen.PrimaryScreen.WorkingArea);

            canvasViewport.InitRootGraphics(myRootGfx, myRootGfx.TopWinEventPortal, internalViewportKind);
            canvasViewport.Bounds =
                new System.Drawing.Rectangle(0, 0,
                    screenClientAreaRect.Width,
                    screenClientAreaRect.Height);
            //---------------------- 
            form1.Controls.Add(canvasViewport);
            //----------------------
            MakeFormCanvas(form1, canvasViewport);

            form1.SizeChanged += (s, e) =>
            {
                if (form1.WindowState == FormWindowState.Maximized)
                {
                    Screen currentScreen = GetScreenFromX(form1.Left);
                    //make full screen ?
                    if (innerViewport != null)
                    {
                        innerViewport.Size = currentScreen.WorkingArea.Size;
                    }
                }
            };
            //----------------------
            return form1;

        }
예제 #11
0
 public void SetUISurfaceViewportControl(LayoutFarm.UI.UISurfaceViewportControl cpuBlitControl)
 {
     _cpuBlitControl = cpuBlitControl;
 }
예제 #12
0
 internal EaseViewport(LayoutFarm.UI.UISurfaceViewportControl viewportControl)
 {
     this.viewportControl = viewportControl;
     this.sampleViewport = new SampleViewport(viewportControl);
 }
예제 #13
0
        public static Form CreateNewFormCanvas(
            int w, int h,
            InnerViewportKind internalViewportKind,
            out LayoutFarm.UI.UISurfaceViewportControl canvasViewport)
        {
            //1. init
            InitWinform();
            IFontLoader fontLoader = s_fontstore;

            //2.
            PixelFarm.Drawing.ITextService ifont = null;
            switch (internalViewportKind)
            {
            default:
                //ifont = PixelFarm.Drawing.WinGdi.WinGdiPlusPlatform.GetIFonts();
                ifont = new OpenFontTextService();
                break;

            case InnerViewportKind.GL:
                ifont = new OpenFontTextService();
                break;
            }

            PixelFarm.Drawing.WinGdi.WinGdiPlusPlatform.SetFontLoader(fontLoader);

            //

            //---------------------------------------------------------------------------

            MyRootGraphic myRootGfx = new MyRootGraphic(
                w, h,
                ifont
                );

            //---------------------------------------------------------------------------

            var       innerViewport        = canvasViewport = new LayoutFarm.UI.UISurfaceViewportControl();
            Rectangle screenClientAreaRect = Conv.ToRect(Screen.PrimaryScreen.WorkingArea);

            canvasViewport.InitRootGraphics(myRootGfx, myRootGfx.TopWinEventPortal, internalViewportKind);
            canvasViewport.Bounds =
                new System.Drawing.Rectangle(10, 10,
                                             screenClientAreaRect.Width,
                                             screenClientAreaRect.Height);
            //----------------------
            Form form1 = new Form();

            //LayoutFarm.Dev.FormNoBorder form1 = new Dev.FormNoBorder();
            form1.Controls.Add(canvasViewport);
            //----------------------
            MakeFormCanvas(form1, canvasViewport);

            form1.SizeChanged += (s, e) =>
            {
                if (form1.WindowState == FormWindowState.Maximized)
                {
                    Screen currentScreen = GetScreenFromX(form1.Left);
                    //make full screen ?
                    if (innerViewport != null)
                    {
                        innerViewport.Size = currentScreen.WorkingArea.Size;
                    }
                }
            };
            //----------------------
            return(form1);
        }
예제 #14
0
 internal EaseViewport(LayoutFarm.UI.UISurfaceViewportControl viewportControl)
 {
     this.viewportControl = viewportControl;
     this.sampleViewport  = new SampleViewport(viewportControl);
 }