Cairo.Context.SetSourceRGBA C# (CSharp) Метод

SetSourceRGBA() публичный Метод

public SetSourceRGBA ( double r, double g, double b, double a ) : void
r double
g double
b double
a double
Результат void
        public void SetSourceRGBA(double r, double g, double b, double a)
        {
            CheckDisposed ();
            NativeMethods.cairo_set_source_rgba (handle, r, g, b, a);
        }

Usage Example

Пример #1
0
        void ExposeTitle(Cairo.Context c)
        {
            // The primary title background
            c.SetSourceRGBA(0, 0, 0, 0.3);
            c.Rectangle(0, m_titleOffset, this.Allocation.Width, m_titleHeight);
            c.Fill();

            // The title shadow (lip)
            c.SetSourceRGBA(0, 0, 0, 0.1);
            c.Rectangle(0, m_titleOffset + m_titleHeight, this.Allocation.Width, m_titleLip);
            c.Fill();

            // Paint the title text
            using (var p = Pango.CairoHelper.CreateLayout(c))
            {
                int w = 0, h = 0, pad = 0;

                p.SetText(m_Title);
                p.GetPixelSize(out w, out h);
                pad = (m_titleHeight - h) / 2;
                c.MoveTo(pad, m_titleOffset + pad);
                c.SetSourceRGB(1.0, 1.0, 1.0);
                Pango.CairoHelper.ShowLayout(c, p);
            }
        }
All Usage Examples Of Cairo.Context::SetSourceRGBA