Esempio n. 1
0
        private void bpAutoGene_Click(object sender, EventArgs e)
        {
            Enabled = false;
            int            nbImages = main.GetMaxImages();
            List <TrameM1> lstTrame = new List <TrameM1>();

            for (int i = 0; i < nbImages; i++)
            {
                main.SelectImage(i);
                DirectBitmap tmp = main.GetResizeBitmap();
                Conversion.CnvTrame(tmp, param, imgCpc, lstTrame, param);
                tmp.Dispose();
                lstTrame.Sort((x, y) => y.nbFound - x.nbFound);
            }
            int maxTrame = Math.Min(16, lstTrame.Count);

            for (int i = 0; i < maxTrame; i++)
            {
                for (int y = 0; y < 4; y++)
                {
                    for (int x = 0; x < 4; x++)
                    {
                        BitmapCpc.trameM1[i, x, y] = lstTrame[i].GetPix(x, y);
                    }
                }
            }

            DrawMatrice();
            DrawTrame();
            Enabled = true;
        }
Esempio n. 2
0
        public void Convert(bool doConvert, bool noInfo = false)
        {
            if (imgSrc.GetImage != null && (autoRecalc.Checked || doConvert) && !noInfo)
            {
                int imgSel   = anim.SelImage;
                int startImg = chkAllPics.Checked ? 0 : imgSel;
                int endImg   = chkAllPics.Checked ? anim.MaxImage : imgSel;
                for (int i = startImg; i <= endImg; i++)
                {
                    SelectImage(i, true);
                    bpSave.Enabled  = bpConvert.Enabled = false;
                    param.sMode     = radioKeepLarger.Checked ? Param.SizeMode.KeepLarger : radioKeepSmaller.Checked ? Param.SizeMode.KeepSmaller : radioFit.Checked ? Param.SizeMode.Fit : Param.SizeMode.UserSize;
                    param.methode   = methode.SelectedItem.ToString();
                    param.pct       = (int)pctTrame.Value;
                    param.diffErr   = chkDiffErr.Checked;
                    param.lockState = imgCpc.lockState;
                    param.setPalCpc = chkPalCpc.Checked;
                    param.trameTc   = chkTrameTC.Checked;
                    param.newReduc  = chkNewReduc.Checked;
                    DirectBitmap tmp = GetResizeBitmap();
                    if (!noInfo && doConvert)
                    {
                        SetInfo(multilingue.GetString("Main.Prg.TxtInfo1"));
                    }

                    Conversion.Convert(tmp, imgCpc, param, !doConvert || noInfo);
                    bpSave.Enabled = bpConvert.Enabled = true;
                    tmp.Dispose();
                }
                SelectImage(imgSel);
            }
            imgCpc.Render();
        }
Esempio n. 3
0
 private void ReleaseMotif()
 {
     if (imgCopy != null)
     {
         imgCopy.Dispose();
         imgCopy = null;
     }
     if (imgMotif != null)
     {
         imgMotif.Dispose();
         imgMotif = null;
     }
     pictureBox.Image = tmpLock != null ? tmpLock.Bitmap : BmpLock.Bitmap;
 }