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); }
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); }
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)); }
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); }
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()); } } }
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); }
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()); } }
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)); }
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); } } } } }
public void SetPixel(AGS.API.Color color, int x, int y) { _bitmap.SetPixel(x, y, color.Convert()); }
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()))); }
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()))); }
public IBrush LoadSolidBrush(AGS.API.Color color) { return(DesktopBrush.Solid(color)); }
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); }
public IBrush LoadHatchBrush(HatchStyle hatchStyle, AGS.API.Color color, AGS.API.Color backgroundColor) { throw new NotImplementedException(); }
public GLVertex(Vector2 position, Vector2 texCoord, Color color) : this(position, texCoord, color.R / 255f, color.G / 255f, color.B / 255f, color.A / 255f) { }
public IBrush LoadSolidBrush(AGS.API.Color color) { return(AndroidBrush.Solid(color)); }
public void MakeTransparent(AGS.API.Color color) { _bitmap.MakeTransparent(color.Convert()); }
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)); }
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(); }
public IMask Load(IBitmap image, bool transparentMeansMasked = false, Color? debugDrawColor = null, string saveMaskToFile = null) { return load(null, image, transparentMeansMasked, debugDrawColor, saveMaskToFile); }