public DiagnoseForm(GtaReaderSession session) { InitializeComponent(); this.session = session; LoadChallenge(0, 0, answerInfo11, answerView11); LoadChallenge(1, 0, answerInfo21, answerView21); LoadChallenge(0, 1, answerInfo12, answerView12); LoadChallenge(1, 1, answerInfo22, answerView22); LoadChallenge(0, 2, answerInfo13, answerView13); LoadChallenge(1, 2, answerInfo23, answerView23); LoadChallenge(0, 3, answerInfo14, answerView14); LoadChallenge(1, 3, answerInfo24, answerView24); SetImageOnView(session.matches[0].ReadDataAsBitmap(), matchView1); SetImageOnView(session.matches[1].ReadDataAsBitmap(), matchView2); SetImageOnView(session.matches[2].ReadDataAsBitmap(), matchView3); SetImageOnView(session.matches[3].ReadDataAsBitmap(), matchView4); SetImageOnView(session.screenshot.GetCloneTarget().ReadDataAsBitmap(), screenFingerprint); SetImageOnView(session.file.finger.ReadDataAsBitmap(), matchedFingerprint); //Make info text string infoText = $"Is 16:9:\n{session.screenshot.is169.ToString()}\n\nIs Windowed:\n{session.screenshot.isWindowed}\n\nImage Resized:\n{session.screenshot.imageResized.ToString()}\n\nFinger Packs Loaded:\n"; foreach (var p in session.registeredFingers) { infoText += $">{p.name} (modified {p.modified_utc.ToShortDateString()} {p.modified_utc.ToLongTimeString()})\n"; } infoLabel.Text = infoText; }
public void ScanPressed() { //Clear and set to busy so we don't confuse the user SetBusy(true); Update(); //Capture screenshot Bitmap screenshot = ScreenshotCaptureTool.AltCaptureScreenshot(gtaProcess); //Open session session = new GtaReaderSession(Program.registeredFingers, screenshot, !isFullscreenCheck.Checked); //Warn if this is not a 16:9 screen if (!session.screenshot.is169 && !hasAspectWarned) { MessageBox.Show("Your game is not running in a 16:9 aspect ratio (1280x720, 1920x1080). This program will likely not work. This dialog won't appear again until you restart this program.", "Bad Screen Aspect Ratio", MessageBoxButtons.OK, MessageBoxIcon.Warning); hasAspectWarned = true; } //Update each cell foreach (var challenge in session.screenChallenges) { //Get cell var cell = cells[challenge.fingerX, challenge.fingerY]; //Check if this was a match int matchIndex = session.matches.IndexOf(challenge); //Set cell.UpdateActive(matchIndex != -1); SetImageOnView(challenge.ReadDataAsBitmap(), cell.picture); } //Show all SetBusy(false); }