Beispiel #1
0
        public int ExeGraphCompare(int[] lXferData, string[] lXferFile, ref string Msg, ref bool Result, int Line)
        {
            Bitmap BmpImage;
            int    ret = 0;

            if (lXferData.Length > 0)
            {
                WarnResult(IMGCMPTOKEN, NOPARAMETER, ref Msg, Line);
            }
            if (lXferFile.Length < 3)
            {
                Result = false; ErrResult(IMGCMPTOKEN, NOPARAMETER, ref Msg, Line); return(SystemInfo.ERROR_CMP_NOPARAM);
            }
            SL_Img_Lib CmpImg = new SL_Img_Lib(lXferFile[0]);

            ret = CmpImg.CompareGrpah(lXferFile[1], ref Msg, ref lCmpInfo);

            if (ret == SystemInfo.ERROR_CMP_FILENOTEXIST)
            {
                WarnResult(IMGCMPTOKEN, FILENOTEXIST, ref Msg, Line);
            }
            else if (ret == SystemInfo.ERROR_CMP_ERROR)
            {
                CmpImg.SaveTxtResult(lXferFile[2], ref lCmpInfo, true);
                BmpImage = CmpImg.getResultBmp();
                BmpImage.Save(lXferFile[2]);
                WarnResult(IMGCMPTOKEN, BMPCMPNOTMATCH, ref Msg, Line);
            }
            else
            {
                WarnResult(IMGCMPTOKEN, BMPCMPMATCH, ref Msg, Line);
            }

            return(Chip.ERROR_RESULT_OK);
        }
Beispiel #2
0
        public bool ImageShow(string FilePath, ref string RdStr)
        {
            SL_Img_Lib ImgLib = new SL_Img_Lib();

            if (!ImgLib.isFileExist(FilePath))
            {
                RdStr = "File Not Exits"; return(false);
            }
            return(ImageWrite(ImgLib));
        }
Beispiel #3
0
        public bool ImageShow(string FilePath)
        {
            SL_Img_Lib ImgLib = new SL_Img_Lib();

            if (!ImgLib.isFileExist(FilePath))
            {
                return(false);
            }
            return(ImageWrite(ImgLib));
        }
Beispiel #4
0
        public bool WrByteToBmp(ResultInfo FileInfo, byte[] rdData, bool delFile)
        {
            string ImgFilePath = FileInfo.FilePath;

            if (delFile)
            {
                new SL_IO_Util().FileDelete(ImgFilePath);
            }
            SL_Img_Lib bmpUtil = new SL_Img_Lib(ImgFilePath);

            byte[] Data      = bmpUtil.ArrageData(FileInfo, rdData);
            Bitmap SaveImage = bmpUtil.CreateBmp(Data, FileInfo.Width, FileInfo.Heigth);

            SaveImage.Save(FileInfo.FilePath, System.Drawing.Imaging.ImageFormat.Bmp);
            return(true);
        }
Beispiel #5
0
        private bool ImageWrite(SL_Img_Lib ImgLib)
        {
            List <byte> lXferData = new List <byte>();

            ImgLib.BmpToList(ref lXferData);
            SL_Comm_Base.SL_CommBase_WriteReg(0xbc, 0x00);
            SL_Comm_Base.SL_CommBase_WriteReg(0x93, 0x03);

            SL_Comm_Base.SPI_WriteReg(0xb8, 0x00, 0x00);
            SL_Comm_Base.SPI_WriteReg(0xb7, 0x06, 0x59);
            Thread.Sleep(10);
            SL_Comm_Base.DDR_MassWrite(0x84, 1, lXferData.ToArray(), lXferData.Count);

            SL_Comm_Base.SPI_WriteReg(0xb8, 0x00, 0x00);
            SL_Comm_Base.SPI_WriteReg(0xb7, 0x06, 0x59);
            SL_Comm_Base.SL_CommBase_WriteReg(0xbc, 0x11);
            Thread.Sleep(2);
            return(true);
        }