GenerateGenericCurveImage() public method

public GenerateGenericCurveImage ( Size size, bool inactive = false ) : Bitmap
size System.Drawing.Size
inactive bool
return System.Drawing.Bitmap
Esempio n. 1
0
        private void PopulateListWithCurves()
        {
            listViewCurves.BeginUpdate();
            listViewCurves.Items.Clear();

            listViewCurves.LargeImageList = new ImageList {
                ColorDepth = ColorDepth.Depth32Bit, ImageSize = new Size(68, 68)
            };

            foreach (KeyValuePair <string, Curve> kvp in Library)
            {
                Curve  c    = kvp.Value;
                string name = kvp.Key;

                var      image = c.GenerateGenericCurveImage(new Size(68, 68));
                Graphics gfx   = Graphics.FromImage(image);
                gfx.DrawRectangle(new Pen(Color.FromArgb(136, 136, 136), 2), 0, 0, 68, 68);

                listViewCurves.LargeImageList.Images.Add(name, image);

                ListViewItem item = new ListViewItem {
                    Text = name, Name = name, ImageKey = name, Tag = c
                };
                item.ForeColor = ThemeColorTable.ForeColor;
                listViewCurves.Items.Add(item);
            }

            listViewCurves.EndUpdate();

            buttonEditCurve.Enabled     = false;
            buttonDeleteCurve.Enabled   = false;
            buttonEditCurve.ForeColor   = ThemeColorTable.ForeColorDisabled;
            buttonDeleteCurve.ForeColor = ThemeColorTable.ForeColorDisabled;
        }
Esempio n. 2
0
 private Bitmap GetCurveBitmap(Curve curve)
 {
     var curveBitmap = new Bitmap((curve.GenerateGenericCurveImage(new Size(48, 48))));
     return drawBitmapBorder(curveBitmap);
 }