Ejemplo n.º 1
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
            {
            }
        }
Ejemplo n.º 2
0
        public void OpenImage(Bitmap btm, string imgPath, IIXC_Image img_for_open, IIXC_Inst inst, IXC_PageFormat pgFmt)
        {
            btm = null;
            img_for_open.Load(imgPath); //Load image from it path
            IIXC_Page page_ixc = img_for_open.GetPage(0);

            page_ixc.ConvertToFormat(pgFmt);
            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);
                }
            }
        }