示例#1
0
        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);
        }
示例#2
0
 private RectangleF GetRectangleF(Vex.Rectangle rect)
 {
     return new RectangleF(rect.Point.X, rect.Point.Y, rect.Size.Width, rect.Size.Height);
 }
示例#3
0
 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);
 }
示例#4
0
 private Ms.Color GetColor(Vex.Color c)
 {
     return Ms.Color.FromArgb(c.ARGB);
 }