Exemplo n.º 1
0
        public BrushImageTestPage()
        {
            InitializeComponent();

            ButtonSolid.Clicked          += OnClickedSolid;
            ButtonGradientLinear.Clicked += OnClickedLinear;
            ButtonGradientRadial.Clicked += OnClickedRadial;

            Image1.SetImage(ResourcePath + "tizen.png");
            Image2.SetImage(ResourcePath + "xamarin_logo.png");

            PropertyArray stopColor = new PropertyArray();

            stopColor.Add(new PropertyValue(new Vector4(255.0f, 0.0f, 0.0f, 255.0f) / 255.0f));
            stopColor.Add(new PropertyValue(new Vector4(0.0f, 255.0f, 0.0f, 255.0f) / 255.0f));

            LinearGradient               = new GradientVisual();
            LinearGradient.StopColor     = stopColor;
            LinearGradient.StartPosition = new Vector2(0.0f, 0.0f);
            LinearGradient.EndPosition   = new Vector2(0.3f, 0.3f);
            LinearGradient.Origin        = Visual.AlignType.TopBegin;

            RadialGradient           = new GradientVisual();
            RadialGradient.Center    = new Vector2(0.0f, 0.0f);
            RadialGradient.Radius    = 0.5f;
            RadialGradient.StopColor = stopColor;
            RadialGradient.Origin    = Visual.AlignType.TopBegin;
        }