TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
SONU GUPTA
NA
40
4.4k
How to trace a written text is correct or not
Jun 1 2018 3:37 AM
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)
{
// Create pen.
Pen blackPen =
new
Pen(Color.Black, 3);
// Create coordinates of rectangle to bound ellipse.
float
x1 = 460.0F;
float
x2 = 510.0F;
float
y = 190.0F;
float
width = 40.0F;
float
height = 75.0F;
// Create start and sweep angles on ellipse.
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));
// Draw arc to screen.
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
Reply
Answers (
0
)
Why is User Control's size get bigger automatically
checking correct or not