예제 #1
0
    void HandleSizeChange(object o, SizeChangeArgs args)
    {
        Stage stage = Stage.Default;
        int   new_x = 0;
        int   new_y = 0;

        int new_width  = 0;
        int new_height = (args.Height * (int)stage.Width) / args.Width;

        if (new_height <= stage.Height)
        {
            new_width = (int)stage.Width;

            new_x = 0;
            new_y = ((int)stage.Height - new_height) / 2;
        }
        else
        {
            new_width = (args.Width * (int)stage.Height) / args.Height;

            new_x = ((int)stage.Width - new_width) / 2;
            new_y = 0;
        }

        vtexture.SetPosition(new_x, new_y);
        vtexture.SetSize(new_width, new_height);
    }
예제 #2
0
 private void OnVideoTextureSizeChange(object o, SizeChangeArgs args)
 {
     AllocateVideoTexture (args.Width, args.Height);
 }
예제 #3
0
    void HandleSizeChange(object o, SizeChangeArgs args)
    {
        Stage stage = Stage.Default;
        int new_x = 0;
        int new_y = 0;

        int new_width = 0;
        int new_height = (args.Height * (int)stage.Width) / args.Width;

        if (new_height <= stage.Height) {
            new_width = (int)stage.Width;

            new_x = 0;
            new_y = ((int)stage.Height - new_height) / 2;
        }
        else {
            new_width = (args.Width * (int)stage.Height) / args.Height;

            new_x = ((int)stage.Width - new_width) / 2;
            new_y = 0;
        }

        vtexture.SetPosition (new_x, new_y);
        vtexture.SetSize (new_width, new_height);
    }