Ejemplo n.º 1
0
		public async Task Icon ()
		{
			var size = new Size (64);
			var canvas = Platforms.Current.CreateImageCanvas (size, scale: 2);
			canvas.SaveState ();
			canvas.Scale (size);
			canvas.Translate (1 / 8.0, 0);

			var p = new Path ();
			p.MoveTo (0, 1,false);
			p.LineTo (0, 0, false);
			p.LineTo (0.5, 1, false);
			p.LineTo (0.5, 0,false);

			var colors = new [] {
				"#DCDCDD",
				"#C5C3C6",
				"#46494C",
				"#4C5C68",
				"#68A5E2",
			};
			foreach (var c in colors) {
				p.Pen = new Pen (c, 1 / 4.0);
				p.Draw (canvas);
				canvas.Translate (1 / 16.0, 0);
			}
      await SaveImage (canvas, "Icon.png");
		}
Ejemplo n.º 2
0
		public async Task TriWithRadGrad ()
		{
			var canvas = Platform.CreateImageCanvas (new Size (100), transparency: true);
			var size = new Size (100);
			var b = new RadialGradientBrush (
				new Point (0.5, 1), new Size(1),
				Colors.Yellow, Colors.Blue);
			var p = new Path ();
			p.MoveTo (0, 0, false);
			p.LineTo (size.Width, 0,false);
			p.LineTo (size.Width / 2, size.Height,false);
			p.Close ();
			p.Brush = b;
			p.Draw (canvas);
      await SaveImage(canvas, "ImageCanvas.TriWithRadGrad");
		}