Skip to content

Instantly share code, notes, and snippets.

@mariusz
Created January 21, 2009 11:26
Show Gist options
  • Select an option

  • Save mariusz/49945 to your computer and use it in GitHub Desktop.

Select an option

Save mariusz/49945 to your computer and use it in GitHub Desktop.
void pictureBox2_MouseClick(object sender, MouseEventArgs e)
{
Bitmap bmp = new Bitmap(this.pictureBox2.Image);
Color color = bmp.GetPixel(e.X, e.Y);
Bitmap message = new Bitmap(400, 30);
Graphics gr = Graphics.FromImage(message);
gr.Clear(Color.Black);
if (!(color.B == 0 && color.G == 0 && color.R == 0))
{
double value = this.view.GetTemparature((double)color.R / (double)255, (double)color.G / (double)255, (double)color.B / (double)255);
Font font = new Font("Arial", 15);
gr.DrawString(string.Format("Temperatura : {0}", Math.Round(value, 2).ToString()), new Font("Arial", 15), Brushes.White, new PointF(0, 0));
}
gr.Save();
this.pictureBox3.Image = message;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment