public static void DrawInBitmap(this NCER.AnimationCell cell, Bitmap bm, NCER.MappingFormat mapping, GraphicsBank graphics, int xOffset = 0, int yOffset = 0) { foreach (var oam in cell.oams) { oam.DrawInBitmap(bm, mapping, graphics, xOffset, yOffset); } }
public static Rectangle BoundingBox(this NCER.AnimationCell cell) { Rectangle totalBbox = cell.oams[0].BoundingBox(); for (int oamIndex = 1; oamIndex < cell.oams.Count; ++oamIndex) { var oam = cell.oams[oamIndex]; totalBbox.ExpandAABB(oam.BoundingBox()); } return(totalBbox); }
public static Bitmap DrawOamBoxes(this NCER.AnimationCell cell, Color lineColor) { Rectangle bbox = cell.BoundingBox(); Bitmap bm = new Bitmap(bbox.Width + 1, bbox.Height + 1); var g = System.Drawing.Graphics.FromImage(bm); var pen = new Pen(lineColor); foreach (var oam in cell.oams) { g.DrawRectangle(pen, oam.X - bbox.X, oam.Y - bbox.Y, (int)oam.Width, (int)oam.Height); } return(bm); }