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
RITU goel
NA
23
434
WPF app for pattern generated by intersecting circles
Apr 26 2018 12:29 AM
Hi,
I am making a C# based windows application in Visual studio 2017.
I am using below code to take center of circles from a file and plotting them with increasing radius. Also, I need to remove the intersection part of all circles.
Please suggest if I can do all the calculations in paint event or I used only only call paint event from other methods.
protected
override
void
OnPaint(PaintEventArgs e)
{
e.Graphics.TranslateTransform(
this
.ClientRectangle.Width / 3,
this
.ClientRectangle.Height / 3);
Pen linePen =
new
Pen(System.Drawing.Color.CornflowerBlue);
Int32 Num_of_Lines;
Int32 gridLength;
Int32 gridWidth;
Int32 Size_of_circle;
while
(r < 300)
{
for
(theta1 = 0; theta1 <= 360; theta1 = theta1 + .360F)
{
foreach
(PointF point
in
this
.circleCoordinates)
{
Pen redPen1 =
new
Pen(Color.Red, 100);
e.Graphics.DrawArc(Pens.Red, point.X, point.Y, r, r, theta1, theta1 + .360F);
}
}
e.Graphics.Clear(blue);
r = r + 25;
}
foreach
(PointF point
in
this
.circleCoordinates)
{
Pen redPen1 =
new
Pen(Color.Red, 100);
e.Graphics.DrawArc(Pens.Red, point.X, point.Y, 200, 200, 0, 360F);
}
linePen.Dispose();
base
.OnPaint(e);
}
Please suggest solution for this, Also, give your mail id, so that I can ask my question there.
Reply
Answers (
0
)
Create rounded button c#
Index was outside the bounds of the array C#