这个用winform大概可以画出,但是清晰度不够,后面会用chart控件 和 wpf的效果去进行比较。如下,不考虑输入参数和清空按钮的话,你需要一个panel控件和一个 button按钮就可以了。
清晰度,可以对graphics进行一些设置。
g.SmoothingMode = SmoothingMode.HighQuality; //图片柔顺模式选择
g.InterpolationMode = InterpolationMode.HighQualityBicubic;//高质量
g.CompositingQuality = CompositingQuality.HighQuality;//再加一点
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace _1_4GraphicsWinform
{
public partial class Form9 : Form
{
public Form9()
{
InitializeComponent();
}
Graphics g;
int x0 = 200;
int y0 = 200;
Font font;
FontFamily fm;
int X0 = 0;
int m = 1;
float fraction1 = 0.5f;
float fraction2 = (float)1 / 6;
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text==null || textBox1.Text == ""|| textBox2.Text == null || textBox2.Text ==