Exemplo n.º 1
0
        public PropertyPage AddPropertyPage(string text, string image)
        {
            var suffix = Direct2DTheme.DialogScaling > 1.0f ? "@2x" : "";
            var bmp    = Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream($"FamiStudio.Resources.{image}{suffix}.png")) as Bitmap;

            if ((Direct2DTheme.DialogScaling % 1.0f) != 0.0f)
            {
                var newWidth  = (int)(bmp.Width * (Direct2DTheme.DialogScaling / 2.0f));
                var newHeight = (int)(bmp.Height * (Direct2DTheme.DialogScaling / 2.0f));

                bmp = new System.Drawing.Bitmap(bmp, newWidth, newHeight);
            }

            var page = new PropertyPage();

            page.Dock = DockStyle.Fill;
            panelProps.Controls.Add(page);

            var tab = new PropertyPageTab();

            tab.button     = AddButton(text, bmp);
            tab.properties = page;

            tabs.Add(tab);

            return(page);
        }
Exemplo n.º 2
0
        public PropertyPage AddPropertyPage(string text, string image)
        {
            var suffix = DpiScaling.Dialog > 1.0f ? "@2x" : "";
            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream($"FamiStudio.Resources.{image}{suffix}.png");

            if (stream == null)
            {
                Debug.WriteLine($"Error loading bitmap {image }.");
            }

            var bmp = stream != null?Image.FromStream(stream) as Bitmap : null;

            if ((DpiScaling.Dialog % 1.0f) != 0.0f && bmp != null)
            {
                var newWidth  = (int)(bmp.Width * (DpiScaling.Dialog / 2.0f));
                var newHeight = (int)(bmp.Height * (DpiScaling.Dialog / 2.0f));

                bmp = new Bitmap(bmp, newWidth, newHeight);
            }

            var page = new PropertyPage();

            page.Dock = DockStyle.Fill;
            panelProps.Controls.Add(page);

            var tab = new PropertyPageTab();

            tab.button     = AddButton(text, bmp);
            tab.properties = page;

            tabs.Add(tab);

            return(page);
        }
Exemplo n.º 3
0
        public PropertyPage AddPropertyPage(string text, string image)
        {
            var tab = new PropertyPageTab();

            tab.text       = text;
            tab.image      = image;
            tab.properties = new PropertyPage(FamiStudioForm.Instance);
            tabs.Add(tab);

            return(tab.properties);
        }
Exemplo n.º 4
0
        public PropertyPage AddPropertyPage(string text, string image)
        {
            var bmp = Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream($"FamiStudio.Resources.{image}.png")) as Bitmap;

            var page = new PropertyPage();

            page.Dock = DockStyle.Fill;
            panelProps.Controls.Add(page);

            var tab = new PropertyPageTab();

            tab.button     = AddButton(text, bmp);
            tab.properties = page;

            tabs.Add(tab);

            return(page);
        }
Exemplo n.º 5
0
        public PropertyPage AddPropertyPage(string text, string image)
        {
            var pixbuf = Gdk.Pixbuf.LoadFromResource("FamiStudio.Resources." + image + ".png");

            var page = new PropertyPage();

            page.Show();
            if (tabs.Count == 0)
            {
                propsVBox.PackStart(page, false, false, 0);
            }

            var tab = new PropertyPageTab();

            tab.button     = AddButton(text, pixbuf);
            tab.properties = page;

            tabs.Add(tab);

            return(page);
        }
Exemplo n.º 6
0
        public PropertyPage AddPropertyPage(string text, string image)
        {
            var suffix = DpiScaling.Dialog >= 2.0f ? "@2x" : "";
            var pixbuf = Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.{image}{suffix}.png");

            var page = new PropertyPage();

            page.Show();
            if (tabs.Count == 0)
            {
                propsVBox.PackStart(page, false, false, 0);
            }

            var tab = new PropertyPageTab();

            tab.button     = AddButton(text, pixbuf);
            tab.properties = page;

            tabs.Add(tab);

            return(page);
        }