示例#1
0
        public void ResetSheet(int size)
        {
            if (cutSheet < 0)
            {
                cutSheet = (int)CutLibWrapper.CreateSheet(size);
            }

            CutLibWrapper.ResetSheet((uint)cutSheet, size);

            curSize = size;
        }
示例#2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            vv.Document.LoadSVGFromFile("d:\\teste_desenho.svg");

            DoubleBuffered = true;
            //vv.Document.LoadSVGFromFile("D:\\COROLLA SEDAN ANO 2009 A 2014 (16).svg");

            int time = Environment.TickCount;

            File.WriteAllText("D:\\out.svg", vv.Document.ToSVG());
            time = Environment.TickCount - time;

            vv.Document.OffsetX = 0;
            vv.Document.OffsetY = 0;

            vv.Document.Debbuging     = false;
            vv.Document.ShowDocBorder = true;
            vv.Document.ShowDocInfo   = true;

            vv.AllowTransforms = true;
            vv.ShowGrid        = true;

            sheet = CutLibWrapper.CreateSheet(600);
            shape = CutLibWrapper.CreateShape(sheet, 1);

            time = Environment.TickCount;

            foreach (VectorPath p in vv.Document.DocPaths())
            {
                p.Shape = p.GenerateCutShape(sheet);
                p.Sheet = sheet;
            }

            time = Environment.TickCount - time;

            //MessageBox.Show(time.ToString());


            //pictureBox1.Image = images[0];
            int i = Environment.TickCount;

            //CutLibWrapper.Plot(sheet, shape, 0, 100, 40);
            //CutLibWrapper.Plot(sheet, shape, 90, 370, 120);
            //CutLibWrapper.Plot(sheet, shape, 180, 470, 120);

            //path.Translate(340, 120);
            //path.SetPos(340, 120);

            /*
             * CutLibWrapper.TestShape(sheet, shape, ref res);
             *
             * if (res.resultOK)
             * {
             *  CutLibWrapper.Plot(sheet, shape, res.angle, res.x, res.y);
             *  path.SetPos(res.x, res.y);
             *  path.Rotate(res.angle);
             * }
             */

            i = Environment.TickCount - i;

            Text = i.ToString();

            vv.AllowMoveDocument = true;
            vv.AutoFit();

            //vv.Document.AutoFit(vv.ClientRectangle, VectorFitStyle.Both, true, VectorFitRegion.Document, 100);
        }