Exemplo n.º 1
0
 public ViewProperties(AxPXV_Control axPXV_Control1)
 {
     InitializeComponent();
     checkBox1.Checked = true;
     workspace_ob = new Workspace();
     this.axPXV_Control1 = axPXV_Control1;
 }
Exemplo n.º 2
0
 public ViewProperties(AxPXV_Control axPXV_Control1)
 {
     InitializeComponent();
     checkBox1.Checked   = true;
     workspace_ob        = new Workspace();
     this.axPXV_Control1 = axPXV_Control1;
 }
Exemplo n.º 3
0
 public static void SaveImage(AxPXV_Control axPXV_Control1, Workspace workspace_ob, string imageDest, IXC_ImageFileFormatIDs format)
 {
     IXC_PageFormat nFormat = IXC_PageFormat.PageFormat_8Indexed;
     IIXC_Inst inst = (IIXC_Inst)axPXV_Control1.Inst.GetExtension("IXC");
     IIXC_Page page_ixc = inst.Page_CreateEmpty((uint)workspace_ob.field_ex.width, (uint)workspace_ob.field_ex.heigth, nFormat, 324345);
     page_ixc.PaletteSize = (uint)workspace_ob.keys.Count;
     for (int i = 0; i < workspace_ob.field_ex.width; i++)
     {
         for (int j = 0; j < workspace_ob.field_ex.heigth; j++)
         {
             Color clr = workspace_ob.field_ex.clr_fild[i][j];
             uint clgr = (uint)((byte)(clr.R) | ((UInt16)((byte)(clr.G)) << 8)) | (((UInt32)(byte)(clr.B)) << 16);
             page_ixc.SetPixel(i, j, (uint)clgr, (uint)IXC_ColorFlags.Color_AddColor);
         }
     }
     page_ixc.ConvertToFormat(nFormat);
     IIXC_Image img = inst.CreateEmptyImage();
     img.InsertPage(page_ixc);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_FILTER, 0);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_FORMAT, (uint)format);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_ITYPE, 16);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_COMP_LEVEL, 2);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_COMP_TYPE, 0);
     img.Save(imageDest, IXC_CreationDisposition.CreationDisposition_Overwrite);
 }
Exemplo n.º 4
0
        public static void OpenImage(AxPXV_Control axPXV_Control1, out Bitmap btm, string imgPath)
        {
            btm = null;
            try
            {
                IIXC_Inst inst = (IIXC_Inst)axPXV_Control1.Inst.GetExtension("IXC"); //Create new instance
                IIXC_Image img_for_open = inst.CreateEmptyImage(); //Crete new empty image for open file
                img_for_open.Load(imgPath); //Load image from it path

                IIXC_Page page_ixc = img_for_open.GetPage(0); //Create new page from image
                page_ixc.ConvertToFormat(IXC_PageFormat.PageFormat_8Indexed);
                btm = new Bitmap((int)page_ixc.Width, (int)page_ixc.Height); //Converting by pixels page to C# bitmap
                for (int i = 0; i < page_ixc.Width; i++)
                {
                    for (int j = 0; j < page_ixc.Height; j++)
                    {
                        int color = (int)page_ixc.GetPixel(i, j);
                        Color clr = ColorTranslator.FromWin32(color);
                        btm.SetPixel(i, j, clr);
                    }
                }
            }
            catch
            {

            }
        }
Exemplo n.º 5
0
        public static void SaveImage(AxPXV_Control axPXV_Control1, Workspace workspace_ob, string imageDest, IXC_ImageFileFormatIDs format)
        {
            IXC_PageFormat nFormat  = IXC_PageFormat.PageFormat_8Indexed;
            IIXC_Inst      inst     = (IIXC_Inst)axPXV_Control1.Inst.GetExtension("IXC");
            IIXC_Page      page_ixc = inst.Page_CreateEmpty((uint)workspace_ob.field_ex.width, (uint)workspace_ob.field_ex.heigth, nFormat, 324345);

            page_ixc.PaletteSize = (uint)workspace_ob.keys.Count;
            for (int i = 0; i < workspace_ob.field_ex.width; i++)
            {
                for (int j = 0; j < workspace_ob.field_ex.heigth; j++)
                {
                    Color clr  = workspace_ob.field_ex.clr_fild[i][j];
                    uint  clgr = (uint)((byte)(clr.R) | ((UInt16)((byte)(clr.G)) << 8)) | (((UInt32)(byte)(clr.B)) << 16);
                    page_ixc.SetPixel(i, j, (uint)clgr, (uint)IXC_ColorFlags.Color_AddColor);
                }
            }
            page_ixc.ConvertToFormat(nFormat);
            IIXC_Image img = inst.CreateEmptyImage();

            img.InsertPage(page_ixc);
            page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_FILTER, 0);
            page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_FORMAT, (uint)format);
            page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_ITYPE, 16);
            page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_COMP_LEVEL, 2);
            page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_COMP_TYPE, 0);
            img.Save(imageDest, IXC_CreationDisposition.CreationDisposition_Overwrite);
        }
Exemplo n.º 6
0
        public static void OpenImage(AxPXV_Control axPXV_Control1, out Bitmap btm, string imgPath)
        {
            btm = null;
            try
            {
                IIXC_Inst  inst         = (IIXC_Inst)axPXV_Control1.Inst.GetExtension("IXC"); //Create new instance
                IIXC_Image img_for_open = inst.CreateEmptyImage();                            //Crete new empty image for open file
                img_for_open.Load(imgPath);                                                   //Load image from it path

                IIXC_Page page_ixc = img_for_open.GetPage(0);                                 //Create new page from image
                page_ixc.ConvertToFormat(IXC_PageFormat.PageFormat_8Indexed);
                btm = new Bitmap((int)page_ixc.Width, (int)page_ixc.Height);                  //Converting by pixels page to C# bitmap
                for (int i = 0; i < page_ixc.Width; i++)
                {
                    for (int j = 0; j < page_ixc.Height; j++)
                    {
                        int   color = (int)page_ixc.GetPixel(i, j);
                        Color clr   = ColorTranslator.FromWin32(color);
                        btm.SetPixel(i, j, clr);
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 7
0
 public ViewProperties(AxPXV_Control axPXV_Control1, bool q)
 {
     InitializeComponent();
     checkBox1.Checked = true;
     workspace_ob = new Workspace();
     this.axPXV_Control1 = axPXV_Control1;
     tabControl1.SelectedIndex = 1;
 }
Exemplo n.º 8
0
 public ViewProperties(AxPXV_Control axPXV_Control1, bool q)
 {
     InitializeComponent();
     checkBox1.Checked         = true;
     workspace_ob              = new Workspace();
     this.axPXV_Control1       = axPXV_Control1;
     tabControl1.SelectedIndex = 1;
 }
Exemplo n.º 9
0
        private void Redraw_PDF()
        {
            Rect_size = (page_Width) / (workspace_ob.field_ex.size_rect - 8);
            height = workspace_ob.field_ex.heigth;
            width = workspace_ob.field_ex.width;
            keys_count = workspace_ob.keys.Count;

            AxPXV_Control apx = new AxPXV_Control();
            axPXV_Control1.CreateNewBlankDoc(page_Width, page_Height, 1);

            var page = axPXV_Control1.Doc.CoreDoc.Pages[0];
            var CC = axPXV_Control1.Doc.CoreDoc.CreateContentCreator();

            PXC_Rect rc = new PXC_Rect();
            PXC_Rect rc_out = new PXC_Rect();

            for (int i = 1; i <= width + 1; i++)
            {
                CC.SetLineWidth(1);
                CC.MoveTo(i * Rect_size, Rect_size);
                CC.LineTo(i * Rect_size, Rect_size + (height * Rect_size));
                CC.StrokePath(true);
            }

            for (int i = 1; i <= height + 1; i++)
            {
                CC.SetLineWidth(1);
                CC.MoveTo(Rect_size, i * Rect_size);
                CC.LineTo(Rect_size + (width * Rect_size), i * Rect_size);
                CC.StrokePath(true);
            }

            for (int i = 1; i <= width; i++)
            {
                for (int j = 1; j <= height; j++)
                {
                    x = i * Rect_size + Rect_size;
                    y = j * Rect_size + Rect_size;
                    Color current_field_color = workspace_ob.field_ex.clr_fild[i - 1][j - 1];
                    rc.bottom = y - Rect_size;
                    rc.top = y;
                    rc.left = x - (Rect_size);
                    rc.right = x;


                    if (isColor)
                    {
                        CC.Rect(x - Rect_size, (height * Rect_size) - y + Rect_size * 2, x, (height * Rect_size) - y + Rect_size * 3);
                        CC.SetFillColorRGB(Get_UINT_Color(current_field_color));
                        CC.FillPath(true, true, PXC_FillRule.FillRule_EvenOdd);
                        CC.StrokePath(true);
                        page.PlaceContent(CC.Detach());

                        string current_text = workspace_ob.field_ex.str_fild[i - 1][height - j];
                        CC.SetFillColorRGB(Get_UINT_Color(Color.Black));
                        CC.ShowTextBlock(current_text, ref rc, ref rc,
                            (uint)PXC_DrawTextFlags.DTF_Center | (uint)PXC_DrawTextFlags.DTF_VCenter, (int)-1, null, null, null, out rc_out);
                    }
                    else
                    {
                        string current_text = workspace_ob.field_ex.str_fild[i - 1][height - j];
                        CC.SetFillColorRGB(Get_UINT_Color(Color.Black));
                        CC.ShowTextBlock(current_text, ref rc, ref rc,
                            (uint)PXC_DrawTextFlags.DTF_Center | (uint)PXC_DrawTextFlags.DTF_VCenter, (int)-1, null, null, null, out rc_out);
                    }
                    CC.StrokePath(true);
                    page.PlaceContent(CC.Detach());
                    CC.SetLineWidth(0.5);
                    CC.StrokePath(true);
                }
            }


            Draw_Keys(ref CC, ref page);


            CC.SetLineWidth(0.5);
            CC.StrokePath(true);
            //page.PlaceContent(CC.Detach());

            axPXV_Control1.Refresh();
            axPXV_Control1.Update();
        }