Exemple #1
0
        private RenderTargetBitmap _CreateBitmapImage()
        {
            bool sWhiteBack = (bool)chbWhiteBack.IsChecked;

            if (!sWhiteBack)
            {
                return(bmpGZero);
            }
            var bmpGZeroW = new RenderTargetBitmap((int)PB_GBoard.Width, (int)PB_GBoard.Height, 96, 96, PixelFormats.Default);

            SDKGrp.GBoardPaint(bmpGZeroW, pGP.BDL, "tabACreate", whiteBack: true);
            return(bmpGZeroW);
        }
Exemple #2
0
//@        private int  solLevelCC=0;
//@        private int  solLevelMax=0;
        private void _Display_GB_GBoard(UPuzzle GPML = null, bool DevelopB = false)
        {
            if (GNP00.AnalyzerMode == "MultiSolve" && __DispMode != "Complated")
            {
                return;
            }
            try{
                UPuzzle currentP = GPML ?? pGP;
                if (currentP == null)
                {
                    return;
                }

                lblUnderAnalysis.Visibility = (GNP00.GSmode == "tabASolve")? Visibility.Visible: Visibility.Hidden;
                Lbl_onAnalyzerM.Visibility  = Visibility.Visible;

                SDKGrp.GBoardPaint(bmpGZero, currentP.BDL, GNP00.GSmode, sNoAssist);
                PB_GBoard.Source = bmpGZero;    //◆currentP.BDL set

                __Set_CellsPZMCount();
                txtProbNo.Text          = (currentP.ID + 1).ToString();
                txtProbName.Text        = currentP.Name;
                nUDDifficultyLevel.Text = currentP.DifLevel.ToString();
                //The following code "pMethod" is rewritten to another thread.
                //This may cause an access violation.
                //here Try with try{...} catch(Exception){...}.
                int DiffL = (GNP00.pGP.pMethod == null)? 0: GNP00.pGP.pMethod.DifLevel; //
                lblCurrentnDifficultyLevel.Content = $"Difficulty: {DiffL}";            //CurrentLevel

                if (DevelopB)
                {
                    _Display_Develop();
                }
                if (GNP00.GSmode == "tabASolve")
                {
                    _Display_ExtResultWin();
                }
            }
            catch (Exception e) {
                WriteLine(e.Message + "\r" + e.StackTrace);
#if DEBUG
                using (var fpW = new StreamWriter("Exception_002e.txt", true, Encoding.UTF8)){
                    fpW.WriteLine($"---{DateTime.Now} {e.Message} \r{e.StackTrace}");
                }
#endif
            }
        }