コード例 #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            using (SolidBrush b = JPaint.GetStyleBrush(Style))
            {
                LinearGradientBrush linearGradientBrush = new LinearGradientBrush(this.ClientRectangle, Color.Red, Color.Yellow, 45);
                ColorBlend          cblend = new ColorBlend(3);
                cblend.Colors = new Color[3] {
                    Color.Black, Color.Magenta, Color.Gold
                };
                cblend.Positions = new float[3] {
                    0f, 0.1f, 1f
                };

                linearGradientBrush.InterpolationColors = cblend;
                Rectangle topRect = new Rectangle(0, 0, Width, 5);
                e.Graphics.FillRectangle(linearGradientBrush, topRect);
            }
        }
コード例 #2
0
 private void Start()
 {
     _jpaint = GameObject.Find("JPaint").GetComponent <JPaint>();
 }