public static UnsafeBitmap PackBitmaps(Vex.VexObject vo, Dictionary<uint, Rectangle> outputBitmaps) { Gdi.GdiRenderer renderer = new Gdi.GdiRenderer(); Dictionary<uint, Bitmap> sourceBitmaps = renderer.GenerateMappedBitmaps(vo, true); if (sourceBitmaps.Count == 0) { throw new Exception("There are no symbols to arrange"); } List<ArrangedBitmap> bitmaps = new List<ArrangedBitmap>(); foreach (uint key in sourceBitmaps.Keys) { Vex.IDefinition def = vo.Definitions[key]; Bitmap sbmp = sourceBitmaps[key]; ArrangedBitmap bitmap = new ArrangedBitmap(); bitmap.Width = sbmp.Width + 2; bitmap.Height = sbmp.Height + 2; bitmap.Id = def.Id; bitmaps.Add(bitmap); } Size bmpSize = ProcessRectangles(bitmaps); return CopyBitmapsToOutput(bitmaps, sourceBitmaps, outputBitmaps, bmpSize.Width, bmpSize.Height); }
private RectangleF GetRectangleF(Vex.Rectangle rect) { return new RectangleF(rect.Point.X, rect.Point.Y, rect.Size.Width, rect.Size.Height); }
private System.Drawing.Drawing2D.Matrix GetMatrix(Vex.Matrix m) { return new System.Drawing.Drawing2D.Matrix( m.ScaleX, m.Rotate0, m.Rotate1, m.ScaleY, m.TranslateX, m.TranslateY); }
private Ms.Color GetColor(Vex.Color c) { return Ms.Color.FromArgb(c.ARGB); }