public static void GenerateBitmap(int dim, string path) { string loc = "Equator"; // loc: Equator Position pos = new Position(Position.LATITUDE_POS, 0, 0, 0, Position.LONGITUDE_POS, 0, 0, 0); // time: Now DateTime dt = DateTime.Now; UTCDate udt = new UTCDate(0, null, dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second); // set up constants Colors colors = new Colors(); string font_face = "Arial"; // generate base image GraphBitmap grbit = new GraphBitmap(true, dim, colors, font_face); Bitmap bitmap_plain = grbit.RenderBaseImage(pos, udt); // render current day Bitmap bitmap = grbit.RenderCurrentDay(bitmap_plain, pos, udt); // render caption CaptionInfo ci = new CaptionInfo(loc, pos, udt); bitmap = grbit.RenderCaption(ci); // save grbit.SaveBitmap(bitmap, path); }
public Grapher(int bound_a, int bound_b, int bound_x, int bound_y, Colors colors, string font_face) { this.grid = new Grid(bound_a, bound_b, bound_x, bound_y); this.graph = new Graph(grid.Origin, grid.Deci); this.colors = colors; this.font_face = font_face; }
public GraphBitmap(bool caption, int dim, Colors colors, string font_face) { this.dimensions = dim; this.titleheight = caption ? (int) (.07 * (double) dim) : 0; this.captionheight = caption ? (int) (.34 * (double) dim) : 0; this.font_face = font_face; this.colors = colors; }
private static void GenImg(int dim, Position pos, UTCDate udt) { string path = Formatter.FormatImgFilename(string.Empty, pos, udt); // set up constants Colors colors = new Colors(); string font_face = "Arial"; // generate base image GraphBitmap grbit = new GraphBitmap(false, dim, colors, font_face); Bitmap bitmap_plain = grbit.RenderBaseImage(pos, udt); // render current day Bitmap bitmap_fst = grbit.RenderCurrentDay(bitmap_plain, pos, udt); // save grbit.SaveBitmap(bitmap_fst, path); }