Created
January 21, 2009 11:26
-
-
Save mariusz/49945 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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