最近有个需求就是在多张图上动态的画曲线,并且鼠标放在图上的时候图片放大且此时图上还是继续的画曲线。于是这里就做了个小Test
一、新建一个窗口,添加三张图和一个timer,此处timer是为了每一秒刷新图片
效果图如下:
二、添加一个类 DrawString,用来画图
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Threading;
namespace ImageAndThread
{
class DrawString
{
private string strToShow=null;
private System.Drawing.Image mImage =null;
public DrawString(string str,System.Drawing.Image mImage)
{
this.strToShow = str;
this.mImage = mImage;
}
public void draw()
{
Graphics g = Graphics.Fro