Ejemplo n.º 1
0
        private void LoadImage(string fileName)
        {
            // load ezd
            JczLmc.LoadEzdFile(fileName);

            // get image from sdk
            var img = JczLmc.GetCurPreviewImage(
                this.foregroundPictureBox.Width,
                this.foregroundPictureBox.Height);

            // convert to bitmap for rransparent
            var bitMap = (Bitmap)img;

            bitMap.MakeTransparent();

            this.foregroundPictureBox.Image = bitMap;

            this.foregroundPictureBox.Width  = bitMap.Width;
            this.foregroundPictureBox.Height = bitMap.Height;

            this._ezdOriginalImage = bitMap;

            this.InitialFGImage();

            this.ezdFileLbl.Text = Path.GetFileName(fileName);
        }
Ejemplo n.º 2
0
        private void LMForm_Load(object sender, EventArgs e)
        {
            try
            {
                // Drag and drop
                this.foregroundPictureBox.AllowDrop = true;

                // Drop Down
                var index = 0;

                // Init forground image parent
                this.foregroundPictureBox.Parent = this.backgroundPictureBox;

                // Connect sdk
                var err = JczLmc.Initialize(this.currentPath, false);

                this.backgroundPictureBox.MaximumSize = new Size(ClientRectangle.Width, ClientRectangle.Height);
                this.foregroundPictureBox.MaximumSize = new Size(ClientRectangle.Width, ClientRectangle.Height);

                if (err != 0)
                {
                    XtraMessageBox.Show($@"При инициализации возникла ошибка - {err}", "Error", MessageBoxButtons.OK);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK);
            }
        }
Ejemplo n.º 3
0
        public static void LoadImage(string fileName)
        {
            JczLmc.ClearLibAllEntity();

            // load ezd
            JczLmc.LoadEzdFile(fileName);
        }
Ejemplo n.º 4
0
        public static Image UpdateEzdApi(CompetitorData competitor, int width, int height)
        {
            if (!string.IsNullOrEmpty(competitor.FirstName))
            {
                JczLmc.ChangeTextByName(JczLmc.GetEntityNameByIndex(0), competitor.FirstName);
            }

            if (!string.IsNullOrEmpty(competitor.LastName))
            {
                JczLmc.ChangeTextByName(JczLmc.GetEntityNameByIndex(1), competitor.LastName);
            }

            if (!string.IsNullOrEmpty(competitor.TimeOfDistance))
            {
                JczLmc.ChangeTextByName(JczLmc.GetEntityNameByIndex(2), competitor.TimeOfDistance);
            }

            if (!string.IsNullOrEmpty(competitor.Distance))
            {
                JczLmc.ChangeTextByName(JczLmc.GetEntityNameByIndex(3), competitor.Distance);
            }

            var img = JczLmc.GetCurPreviewImage(width, height);

            img = Images.SetImageTransparent(img);

            return(img);
        }
Ejemplo n.º 5
0
        public static List <Tuple <string, StringBuilder> > GetEzdData()
        {
            var count = JczLmc.GetEntityCount();

            var ezdObjects = new List <Tuple <string, StringBuilder> >();

            var names = new List <string>();

            for (int i = 0; i < count; i++)
            {
                names.Add(JczLmc.GetEntityNameByIndex(i));
            }

            names = names.Where(p => { return(!string.IsNullOrEmpty(p)); }).Distinct().ToList();

            foreach (var name in names)
            {
                if (!string.IsNullOrEmpty(name))
                {
                    var str = new StringBuilder();

                    JczLmc.GetTextByName(name, str);

                    ezdObjects.Add(new Tuple <string, StringBuilder>(name, str));
                }
            }

            return(ezdObjects);
        }
Ejemplo n.º 6
0
        public static Image FontSize(string entName, ModeFontSize mode, int width, int heght)
        {
            StringBuilder font       = new StringBuilder();
            double        height_ezd = 0;
            double        width_ezd  = 0;
            double        angle      = 0;
            double        space      = 0;
            double        line_space = 0;
            bool          bBold      = false;
            int           nTextAlign = 0;
            bool          bItalic    = false;

            int    nTextSpaceMode      = 0;
            double dTextSpace          = 0;
            double dNullCharWidthRatio = 0;

            JczLmc.GetTextEntParam4(entName,
                                    font,
                                    ref nTextSpaceMode,
                                    ref dTextSpace,
                                    ref height_ezd,
                                    ref width_ezd,
                                    ref angle,
                                    ref space,
                                    ref line_space,
                                    ref dNullCharWidthRatio,
                                    ref nTextAlign,
                                    ref bBold,
                                    ref bItalic);
            if (mode == ModeFontSize.Reduce)
            {
                height_ezd = height_ezd - 0.0062d;
                width_ezd  = width_ezd - 0.0062d;
            }
            else
            {
                height_ezd = height_ezd + 0.0062d;
                width_ezd  = width_ezd + 0.0062d;
            }


            JczLmc.SetTextEntParam4(entName,
                                    font.ToString(),
                                    nTextSpaceMode,
                                    dTextSpace,
                                    height_ezd,
                                    width_ezd,
                                    angle,
                                    space,
                                    line_space,
                                    dNullCharWidthRatio,
                                    nTextAlign,
                                    bBold,
                                    bItalic);

            return(JczLmc.GetCurPreviewImage(width, heght));
        }
Ejemplo n.º 7
0
        public static Image UpdateCustomEzd(Tuple <string, string> ezdObj, int width, int height)
        {
            JczLmc.ChangeTextByName(ezdObj.Item1, ezdObj.Item2);

            var img = JczLmc.GetCurPreviewImage(width, height);

            img = PictureControl.Images.SetImageTransparent(img);

            return(img);
        }
Ejemplo n.º 8
0
        public static Image LoadImage(string fileName, int width, int height)
        {
            // load ezd
            JczLmc.LoadEzdFile(fileName);

            // get image from sdk
            var img = JczLmc.GetCurPreviewImage(width, height);

            img = PictureControl.Images.SetImageTransparent(img);

            return(img);
        }
Ejemplo n.º 9
0
        private void Initial()
        {
            // Init waiting bar
            waitingBar = new RadWaitingBar();
            waitingBar.AssociatedControl = this.layoutControl1;
            waitingBar.Size         = new System.Drawing.Size(80, 80);
            waitingBar.WaitingStyle = Telerik.WinControls.Enumerations.WaitingBarStyles.LineRing;

            this.layoutControl1.Controls.Add(waitingBar);

            try
            {
                // Connect sdk
                var err = JczLmc.Initialize(Application.StartupPath, true);

                userDataDtos = UserDataRepository.GetAllUser();

                if (userDataDtos.Count > 0)
                {
                    for (int i = 0; i < userDataDtos.Count; i++)
                    {
                        var image = this.layoutControl1.Controls.OfType <PictureEdit>()
                                    .Where(c => c.TabIndex == i + 40)
                                    .Select(c => c)
                                    .First();

                        image.Image = Image.FromFile($@"{filesPath}{userDataDtos[i].FullImage}");
                        image.Properties.ReadOnly = false;
                        image.Cursor   = Cursors.Hand;
                        image.Tag      = @"filled";
                        currentPEindex = i;
                        if (i + 1 == userDataDtos.Count)
                        {
                            // last plus
                            var lastImage = this.layoutControl1.Controls.OfType <PictureEdit>()
                                            .Where(c => c.TabIndex == (i + 1) + 40)
                                            .Select(c => c)
                                            .First();

                            lastImage.Image  = Image.FromFile($@"{iconsPath}plus.png");
                            lastImage.Cursor = Cursors.Hand;
                            lastImage.Properties.ReadOnly = false;
                            lastImage.Tag = @"next";
                        }
                    }

                    var currentData = userDataDtos.LastOrDefault();

                    UpdateImageFromDB(currentData);

                    this.loginTextEdit.Text = currentData.Login;

                    this.currentPEindex = (int)currentData.Sequence;

                    this.passwordTextEdit.Text = currentData.Password;

                    this.urlTextEdit.Text = currentData.Url;

                    CurrentApiData.Token = currentData.Token;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK);
            }
        }
Ejemplo n.º 10
0
 public static void RedMark()
 {
     int nErr = JczLmc.RedMark();
 }
Ejemplo n.º 11
0
 public static void RedMarkContour()
 {
     int nErr = JczLmc.RedMarkContour();
 }
Ejemplo n.º 12
0
 public static void StopMark()
 {
     int nErr = JczLmc.StopMark();
 }
Ejemplo n.º 13
0
 public static bool IsMarking()
 {
     return(JczLmc.IsMarking());
 }
Ejemplo n.º 14
0
 public static int Mark()
 {
     return(JczLmc.Mark(false));
 }