hey ich möchte den farbcode in einem pixel bekommen und habe folgendes versucht:
jedoch finde ich auf diese methode keine farben in der reihe pixel.
gibt es nicht ein befehl wo man auf den bitmap verzichten könnte?
mfg
sixkay
Code:
[...]
using System.Threading;
namespace WindowsFormsApplication41
{
public partial class Form1 : Form
{
public int Yreihe = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//Thread.Sleep(4000);
Bitmap bmp = new Bitmap(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width,
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
Yreihe = MousePosition.Y;
for (int i = 400; i < 900; i++)
{
Color pixelColor = bmp.GetPixel(i, Yreihe);
if (pixelColor.ToString() != "Color [A=0, R=0, G=0, B=0]")
{
MessageBox.Show(pixelColor.ToString());
}
}
}
}
}
gibt es nicht ein befehl wo man auf den bitmap verzichten könnte?
mfg
sixkay