Üye
direk banlanırsınız
Nereye yazıyorsunuz kodlarıŞuan deniyorum ne zamandan beri arıyordum şimdiden teşekkürler kardeşim
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PixelTracker
{
public partial class Form1 : Form
{
private bool _isTracking = false;
private List<Color> _targetColors = new List<Color>();
private Point _lastPosition;
public int ScanWidth { get; set; } = 75;
public int ScanHeight { get; set; } = 75;
private int _timerInterval = 100;
private Keys _pauseKey = Keys.Pause;
private Button btnToggleTracking;
private NumericUpDown nudScanWidth, nudScanHeight, nudTolerance;
private Label lblScanWidth, lblScanHeight, lblTolerance, lblTargetColor;
private Panel pnlControls, pnlTargetColor;
private ColorDialog colorDialog;
public Form1()
{
InitializeComponent();
InitializeCustomComponents();
_targetColors.Add(Color.FromArgb(255, 255, 192, 203)); // Başlangıç hedef renk
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
KeyPreview = true;
KeyDown += Form1_KeyDown;
timer1.Interval = _timerInterval;
}
private void InitializeCustomComponents()
{
this.BackColor = Color.FromArgb(18, 18, 18);
this.Size = new Size(400, 300);
pnlControls = new Panel
{
Dock = DockStyle.Top,
Height = 80,
BackColor = Color.FromArgb(28, 28, 28),
};
btnToggleTracking = new Button
{
Text = "Start Tracking",
Location = new Point(10, 10),
Width = 120,
};
btnToggleTracking.Click += BtnToggleTracking_Click;
lblScanWidth = new Label { Text = "Scan Width:", Location = new Point(140, 10), ForeColor = Color.White };
lblScanHeight = new Label { Text = "Scan Height:", Location = new Point(140, 40), ForeColor = Color.White };
lblTolerance = new Label { Text = "Tolerance:", Location = new Point(280, 10), ForeColor = Color.White };
lblTargetColor = new Label { Text = "Target Color:", Location = new Point(280, 40), ForeColor = Color.White };
nudScanWidth = new NumericUpDown { Location = new Point(210, 10), Width = 60, Value = ScanWidth };
nudScanHeight = new NumericUpDown { Location = new Point(210, 40), Width = 60, Value = ScanHeight };
nudTolerance = new NumericUpDown { Location = new Point(350, 10), Width = 60, Value = 10 };
pnlTargetColor = new Panel
{
Location = new Point(350, 40),
Size = new Size(20, 20),
BackColor = _targetColors[0],
BorderStyle = BorderStyle.FixedSingle
};
pnlTargetColor.Click += PnlTargetColor_Click;
colorDialog = new ColorDialog();
pnlControls.Controls.AddRange(new Control[] { btnToggleTracking, lblScanWidth, lblScanHeight, lblTolerance, lblTargetColor, nudScanWidth, nudScanHeight, nudTolerance, pnlTargetColor });
this.Controls.Add(pnlControls);
// Event handlers for NumericUpDown controls
nudScanWidth.ValueChanged += (s, e) => { ScanWidth = (int)nudScanWidth.Value; };
nudScanHeight.ValueChanged += (s, e) => { ScanHeight = (int)nudScanHeight.Value; };
nudTolerance.ValueChanged += (s, e) => { /* Implement tolerance logic update */ };
}
private void BtnToggleTracking_Click(object sender, EventArgs e)
{
_isTracking = !_isTracking;
btnToggleTracking.Text = _isTracking ? "Stop Tracking" : "Start Tracking";
}
private void PnlTargetColor_Click(object sender, EventArgs e)
{
if (colorDialog.ShowDialog() == DialogResult.OK)
{
pnlTargetColor.BackColor = colorDialog.Color;
_targetColors[0] = colorDialog.Color; // Update the target color
}
}
// Existing methods (Form1_KeyDown, Form1_MouseDown, etc.) remain unchanged.
}
}
indirme linki yokşöyle bir gram anlasam gam yemicem de 0 bende yine de eline sağlık uzmanlar ilgilenir