本文介绍了MODI图像转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在将图像传递给MODI.Image时遇到了麻烦。这里使用什么样的转换?



错误AS无法将'System.Drawing.Bitmap'类型的对象强制转换为'MODI.Image'。



请帮忙。



提前致谢。



Hi,

I am having trouble while passing image to MODI.Image. What kind of casting to be used here?

Error AS "Unable to cast object of type 'System.Drawing.Bitmap' to type 'MODI.Image'."

Please help.

Thanks in advance.

OracleDataReader o_Reader;
            string str_ExtractNumber;
            str_ExtractNumber = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            o_Reader = qry.GetPhotoByNumber(str_ExtractNumber);
            if (o_Reader.HasRows)
            {
                while (o_Reader.Read())
                {
                    Image newImage;
                    byte[] img_blob = (byte[])o_Reader[0];
                    //MemoryStream ms = new MemoryStream();
                    //ms.Read(img_blob, 0, img_blob.Length);
                    using (MemoryStream ms = new MemoryStream(img_blob, 0, img_blob.Length))
                    {
                        ms.Write(img_blob, 0, img_blob.Length);
                        newImage = Image.FromStream(ms, true);
                    }

             
                    MODI.Image img = (MODI.Image)newImage; // Problem occurs here. Error mentioned in Post.
                    img.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
                    MODI.Layout layout = img.Layout;
                    str_ExtractNumber = img.Layout.Text;
                    txt_Extracted.Text = str_ExtractNumber;

                }
            }

推荐答案


这篇关于MODI图像转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 10:36