Esempio n. 1
0
        private void init(int flg)
        {
            lbase = null;
            switch(flg){
                case 0:
                    lbase = LayoutVertical.getInstance();
                    //int c = 24;
                    if (datas.DataContent.Count > 25)
                    {
                        limit = 1;
                    }
                    break;
                case 1:
                    lbase = LayoutHorizontal.getInstance();
                    //int c = 24;
                    if (datas.DataContent.Count > ((LayoutHorizontal)lbase).pLimit)
                    {
                        limit = 1;
                    }
                    break;
                case 2:
                    lbase = LayoutHorizontalCover.getInstance();
                    //int c = 24;
                    if (datas.DataContent.Count > ((LayoutHorizontalCover)lbase).pLimit)
                    {
                        limit = 1;
                    }
                    break;
                default:
                    break;
            }
            lbase.setDetailData(datas);
            lbase.loadDetailData();
            lbase.draw();
            PrintDocument pd = new PrintDocument();
            g_pd = pd;
            this.ppcPrint.Document = pd;
            pd.PrintPage += pd_PrintPage;
            if(lbase!=null){
                bmp = lbase.draw().ToArray();

                ppcPrint.StartPage = 0;
                ppcPrint.Columns = limit + 1;
                ppcPrint.Rows = 1;
                ppcPrint.InvalidatePreview();
            }
        }
Esempio n. 2
0
        private void init(int flg)
        {
            lbase = null;
            switch(flg){
                case 0:
                    lbase = LayoutVertical.getInstance();
                    int c = 24;
                    if (datas.DataContent.Count > 25)
                    {
                        limit = 1;
                    }
                    break;
                case 1:
                    lbase = LayoutVertical.getInstance();
                    break;
                case 2:
                    lbase = LayoutVertical.getInstance();
                    break;
                default:
                    break;
            }
            lbase.setDetailData(datas);
            lbase.loadDetailData();
            lbase.draw();
            PrintDocument pd = new PrintDocument();
            g_pd = pd;
            this.ppcPrint.Document = pd;
            pd.PrintPage += pd_PrintPage;
            if(lbase!=null){
                bmp = lbase.draw().ToArray();
            }

            if(bmp.Length>1){
                //6ページ目を表示する
                ppcPrint.StartPage = 0;

                //ページを横に3列、縦に2行で表示する
                ppcPrint.Columns = limit+1;
                ppcPrint.Rows = 1;
                ppcPrint.InvalidatePreview();
            }
        }
Esempio n. 3
0
        private void init(int flg)
        {
            lbase = null;
            switch(flg){
                case 0:
                    lbase = LayoutVertical.getInstance();
                    //int c = 24;
                    if (datas.DataContent.Count > 25)
                    {
                        limit = 1;
                    }
                    else
                    {
                        limit = 0;
                    }
                    break;
                case 1:
                    lbase = LayoutHorizontal.getInstance();
                    //int c = 24;
                    if (datas.DataContent.Count > ((LayoutHorizontal)lbase).pLimit)
                    {
                        limit = 1;
                    }
                    else
                    {
                        limit = 0;
                    }
                    break;
                case 2:
                    lbase = LayoutHorizontalCover.getInstance();
                    //int c = 24;
                    /*
                    if (datas.DataContent.Count > ((LayoutHorizontalCover)lbase).pLimit)
                    {
                        limit = 1;
                    }*/
                    limit = 1;
                    break;
                default:
                    break;
            }
            lbase.setDetailData(datas);
            lbase.loadDetailData();
            lbase.draw();
            PrintDocument pd = new PrintDocument();
            g_pd = pd;

            g_pd.PrintPage += pd_PrintPage;
            //if(lbase!=null){
                Bitmap[] b = lbase.draw().ToArray();

                List<Bitmap> a = new List<Bitmap>();
                for (int i = 0; flg == 0 && i < b.Length/2; i += 1 )
                {
                    a.Add(b[i]);
                    //testPreview.bLV = a.ToArray();
                }
                for (int i = 0; flg == 1 && i < b.Length/2; i += 1)
                {
                    a.Add(b[i]);
                    //testPreview.bLH = a.ToArray();
                }
                for (int i = 0; flg == 2 && i < b.Length/2; i += 1)
                {
                    a.Add(b[i]);
                    //testPreview.bLHC = a.ToArray();
                }
                bmp = a.ToArray();
                button1.Text = bmp.Length.ToString();

                if (tP != null)
                {
                    tP.Dispose();
                }

                //tP = new testPreview();
                //tP.Show();

                ppcPrint.Refresh();
                pageCount = 0;
                ppcPrint.StartPage = 0;
                ppcPrint.Columns = limit + 1;
                ppcPrint.Rows = 1;
                ppcPrint.InvalidatePreview();
                this.ppcPrint.Document = g_pd;
            //}
        }