This is the code for writing letter ka
- 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 WindowsFormsApplication56
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Drawcarc(object sender, PaintEventArgs e)
- {
-
- Pen blackPen = new Pen(Color.Black, 3);
-
- float x1 = 460.0F;
- float x2 = 510.0F;
- float y = 190.0F;
- float width = 40.0F;
- float height = 75.0F;
-
- float startAngle1 = 35.0F;
- float startAngle2 = 200.0F;
- float sweepAngle1 = 300.0F;
- float sweepAngle2 = 300.0F;
- float[] dashValues = { 2, 2, 2, 2 };
- blackPen.DashPattern = dashValues;
- e.Graphics.DrawLine(blackPen, new Point(430, 150), new Point(590, 150));
- e.Graphics.DrawLine(blackPen, new Point(505, 160), new Point(505, 290));
-
- e.Graphics.DrawArc(blackPen, x1, y, width, height, startAngle1 , sweepAngle1);
- e.Graphics.DrawArc(blackPen, x2, y, width, height, startAngle2, sweepAngle2);
- }
- }
- }
- THIS IS THE CODE FOR DRAWING
- 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 WindowsFormsApplication58
- {
- public partial class Form1 : Form
- {
- Graphics g;
- int x = -1;
- int y = -1;
- bool moving = false;
- Pen pen;
- public Form1()
- {
- InitializeComponent();
- g = panel1.CreateGraphics();
- g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
- pen = new Pen(Color.Black, 5);
- pen.StartCap = pen.EndCap = System.Drawing.Drawing2D.LineCap.Round;
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- PictureBox p = (PictureBox)sender;
- pen.Color = p.BackColor;
- }
- private void panel1_MouseDown(object sender, MouseEventArgs e)
- {
- moving = true;
- x = e.X;
- y = e.Y;
- }
- private void panel1_MouseMove(object sender, MouseEventArgs e)
- {
- if (moving && x != -1 && y != -1)
- {
- g.DrawLine(pen, new Point(x, y), e.Location);
- x = e.X;
- y = e.Y;
- }
- }
- private void panel1_MouseUp(object sender, MouseEventArgs e)
- {
- moving = false;
- x = -1;
- y = -1;
- }
- }
- }
Now I want if I draw a line over text ka then it should show it is correct otherwise if the line is drawn outside text ka then should show it is not correct