예제 #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);
		}