要求做一个小学加减法教学软件,可以实现自动出题测试功能,就是纠结应该怎样实现加减法一步步的教学过程(比如7+8=15怎样以通俗易懂的形式一步步展示出来,让学生能够听懂的方式),求解答。
2条回答 默认 最新
- threenewbee 2020-03-12 20:19关注
给你做了一个,采纳本回答留下email发给你
其他人如果也需要: https://download.csdn.net/download/caozhy/12244840
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Q1058393.Properties; namespace Q1058393 { public partial class Form1 : Form { private int x = 0; private int y = 0; private int step = 0; private Image genPic(int a, int b) { Bitmap bmp = new Bitmap((a + b) * 60 + 10, 60); Graphics g = Graphics.FromImage(bmp); var graybmp = ToGray(Resources.Image1); for (int i = 0; i < a; i++) { g.DrawImage(Resources.Image1, i * 60, 5); } for (int i = 0; i < b; i++) { g.DrawImage(graybmp, (i + a) * 60, 5); } return bmp; } private Bitmap ToGray(Bitmap bmp) { Bitmap b1 = new Bitmap(bmp.Width, bmp.Height); for (int i = 0; i < bmp.Width; i++) { for (int j = 0; j < bmp.Height; j++) { Color color = bmp.GetPixel(i, j); int gray = (int)(color.R * 0.3 + color.G * 0.59 + color.B * 0.11); Color newColor = Color.FromArgb(gray, gray, gray); b1.SetPixel(i, j, newColor); } } return b1; } public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Random rnd = new Random(); y = 0; while (y == 0) { x = rnd.Next(1, 9); y = rnd.Next(-x + 1, 10 - x); } label1.Text = string.Format("{0}{1}{2}=?", x, y > 0 ? "+" : "", y); label1.Refresh(); pictureBox1.Image = genPic(x, 0); pictureBox1.Refresh(); if (y < 0) pictureBox2.Image = genPic(0, -y); else pictureBox2.Image = genPic(y, 0); pictureBox2.Refresh(); pictureBox3.Image = genPic(0, 0); pictureBox3.Refresh(); } private void timer1_Tick(object sender, EventArgs e) { if (y > 0) pictureBox3.Image = genPic(x + step, 0); else pictureBox3.Image = genPic(x - step, step); pictureBox3.Refresh(); step++; if (y > 0 && step == y + 1) { timer1.Enabled = false; step = 0; } if (y < 0 && step == -y + 1 ) { timer1.Enabled = false; step = 0; } } private void button2_Click(object sender, EventArgs e) { step = 0; timer1.Enabled = true; label1.Text = string.Format("{0}{1}{2}={3}", x, y > 0 ? "+" : "", y, x+y); } } }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
- ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
- ¥15 Arcgis相交分析无法绘制一个或多个图形
- ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
- ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
- ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
- ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
- ¥30 3天&7天&&15天&销量如何统计同一行
- ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
- ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型