Пример #1
0
		public IMask Load(string path, bool transparentMeansMasked = false, 
			Color? debugDrawColor = null, string saveMaskToFile = null, string id = null)
		{
			var resource = _resourceLoader.LoadResource (path);
			IBitmap image = Hooks.BitmapLoader.Load (resource.Stream);
			return load(path, image, transparentMeansMasked, debugDrawColor, saveMaskToFile, id);
		}
Пример #2
0
		public async Task<IMask> LoadAsync (string path, bool transparentMeansMasked = false,
			Color? debugDrawColor = null, string saveMaskToFile = null, string id = null)
		{
			var resource = await Task.Run(() => _resourceLoader.LoadResource (path));
            if (resource == null) return null;
			IBitmap image = await Task.Run(() => Hooks.BitmapLoader.Load (resource.Stream));
			return load (path, image, transparentMeansMasked, debugDrawColor, saveMaskToFile, id);
		}
Пример #3
0
        public IBrush LoadLinearBrush(AGS.API.Point point1, AGS.API.Point point2, AGS.API.Color color1, AGS.API.Color color2)
        {
            var            paint    = AndroidBrush.CreateTextPaint();
            LinearGradient gradient = new LinearGradient(point1.X, point1.Y, point2.X, point2.Y, color1.Convert(), color2.Convert(), Shader.TileMode.Clamp);

            paint.SetShader(gradient);
            return(new AndroidBrush(paint));
        }
Пример #4
0
        public static DesktopBrush Solid(AGS.API.Color color)
        {
            DesktopBrush brush = new DesktopBrush(new SolidBrush(color.Convert()));

            brush.Type  = BrushType.Solid;
            brush.Color = color;
            return(brush);
        }
Пример #5
0
 public void SetPixels(AGS.API.Color color, List <API.Point> points)
 {
     using (FastBitmap bmp = new FastBitmap(_bitmap))
     {
         foreach (var point in points)
         {
             bmp.SetPixel(point.X, point.Y, color.Convert());
         }
     }
 }
Пример #6
0
        public static AndroidBrush Solid(AGS.API.Color color)
        {
            TextPaint paint = CreateTextPaint();

            paint.Color = color.Convert();
            AndroidBrush brush = new AndroidBrush(paint);

            brush.Type  = BrushType.Solid;
            brush.Color = color;
            return(brush);
        }
Пример #7
0
 public void SetPixels(AGS.API.Color color, List <API.Point> points)
 {
     using (FastBitmap bmp = new FastBitmap(_cgImage))
     {
         foreach (var point in points)
         {
             bmp.SetPixel(point.X, point.Y, color);
         }
         setImage(bmp.GetImage());
     }
 }
Пример #8
0
        public IBrush LoadPathsGradientBrush(AGS.API.Color centerColor, AGS.API.PointF centerPoint,
                                             IBlend blend, AGS.API.PointF focusScales, AGS.API.Color[] surroundColors,
                                             IColorBlend interpolationColors, ITransformMatrix transform, AGS.API.WrapMode wrapMode)
        {
            PathGradientBrush g = new PathGradientBrush(new System.Drawing.Point[] { });

            g.Blend               = blend.Convert();
            g.CenterColor         = centerColor.Convert();
            g.CenterPoint         = centerPoint.Convert();
            g.FocusScales         = focusScales.Convert();
            g.SurroundColors      = surroundColors.Convert();
            g.InterpolationColors = interpolationColors.Convert();
            g.Transform           = transform.Convert();
            g.WrapMode            = wrapMode.Convert();
            return(new DesktopBrush(g));
        }
Пример #9
0
 public void MakeTransparent(AGS.API.Color color)
 {
     global::Android.Graphics.Color c           = new global::Android.Graphics.Color(color.R, color.G, color.B, color.A);
     global::Android.Graphics.Color transparent = global::Android.Graphics.Color.Transparent;
     using (FastBitmap fastBitmap = new FastBitmap(_bitmap))
     {
         for (int x = 0; x < Width; x++)
         {
             for (int y = 0; y < Height; y++)
             {
                 if (fastBitmap.GetPixel(x, y) == c)
                 {
                     fastBitmap.SetPixel(x, y, transparent);
                 }
             }
         }
     }
 }
Пример #10
0
 public void SetPixel(AGS.API.Color color, int x, int y)
 {
     _bitmap.SetPixel(x, y, color.Convert());
 }
Пример #11
0
 public IBrush LoadHatchBrush(AGS.API.HatchStyle hatchStyle, AGS.API.Color color, AGS.API.Color backgroundColor)
 {
     return(new DesktopBrush(new HatchBrush(hatchStyle.Convert(), color.Convert(), backgroundColor.Convert())));
 }
Пример #12
0
 public IBrush LoadLinearBrush(AGS.API.Point point1, AGS.API.Point point2, AGS.API.Color color1, AGS.API.Color color2)
 {
     return(new DesktopBrush(new LinearGradientBrush(point1.Convert(), point2.Convert(), color1.Convert(), color2.Convert())));
 }
Пример #13
0
 public IBrush LoadSolidBrush(AGS.API.Color color)
 {
     return(DesktopBrush.Solid(color));
 }
Пример #14
0
		private IMask load(string path, IBitmap image, bool transparentMeansMasked = false, 
			Color? debugDrawColor = null, string saveMaskToFile = null, string id = null)
		{
			return image.CreateMask(_factory, path, transparentMeansMasked, debugDrawColor, saveMaskToFile, id);
		}
Пример #15
0
 public IBrush LoadHatchBrush(HatchStyle hatchStyle, AGS.API.Color color, AGS.API.Color backgroundColor)
 {
     throw new NotImplementedException();
 }
Пример #16
0
		public GLVertex(Vector2 position, Vector2 texCoord, Color color)
			:	this(position, texCoord, color.R / 255f, color.G / 255f, color.B / 255f, color.A / 255f)
		{
		}
Пример #17
0
 public IBrush LoadSolidBrush(AGS.API.Color color)
 {
     return(AndroidBrush.Solid(color));
 }
Пример #18
0
 public void MakeTransparent(AGS.API.Color color)
 {
     _bitmap.MakeTransparent(color.Convert());
 }
Пример #19
0
 public static global::Android.Graphics.Color Convert(this AGS.API.Color color)
 {
     return(new global::Android.Graphics.Color(color.R, color.G, color.B, color.A));
 }
Пример #20
0
 public IBrush LoadPathsGradientBrush(AGS.API.Color centerColor, AGS.API.PointF centerPoint, IBlend blend, AGS.API.PointF focusScales, AGS.API.Color[] surroundColors, IColorBlend interpolationColors, ITransformMatrix transform, WrapMode wrapMode)
 {
     throw new NotImplementedException();
 }
Пример #21
0
		public IMask Load(IBitmap image, bool transparentMeansMasked = false, 
			Color? debugDrawColor = null, string saveMaskToFile = null)
		{
			return load(null, image, transparentMeansMasked, debugDrawColor, saveMaskToFile);
		}