Using ReadLine input for a different method - c#

I'm trying to write a program that, given my choice of variables, depicts a smiley on screen.
I've written the following.
Now my program asks three questions, which I will answer with numbers between 0 and 11. I would like to use these answers in the method 'tekenscherm'. How can I call these variables in that method?
class HalloForm : Form
{
public string a,b,c = ""; //Declare them here.
public HalloForm()
{
this.Text = "Hallo";
this.BackColor = Color.Yellow;
this.Size = new Size(800, 600);
this.Paint += this.tekenScherm;
}
public static void Main()
{
System.Console.WriteLine("Smiley size, on a scale of 1 tot 10?");
string a = System.Console.ReadLine();
Int32.Parse(a);
System.Console.WriteLine("X coordinate of the smiley, on a scale of 1 to 10");
string b = System.Console.ReadLine();
Int32.Parse(b);
System.Console.WriteLine("Y coordinate of the smiley, on a scale of 1 to 10");
string c = System.Console.ReadLine();
Int32.Parse(c);
HalloForm scherm;
scherm = new HalloForm();
Application.Run(scherm);
}
void tekenScherm(object obj, PaintEventArgs pea)
{
SolidBrush blueBrush = new SolidBrush(Color.Blue);
Pen blackBrush = new Pen(Color.Black, 5);
int x = 360;
int y = x + 75;
pea.Graphics.FillEllipse(blueBrush, 300, 200, 200, 200);
pea.Graphics.DrawEllipse(blackBrush, 300, 200, 200, 200);
pea.Graphics.DrawArc(blackBrush, 350, 250, 100, 100, 45, 90);
pea.Graphics.DrawEllipse(blackBrush, a, 250, 5, 5); //I've used it here
pea.Graphics.DrawEllipse(blackBrush, y, 250, 5, 5);
}
}

Declare those variables outside of the method scope as integers.
Int32.Parse returns an integer value, which you are not assigning to those variables, so it's basically doing nothing the way you are using it.
Here is the working code:
class HalloForm : Form
{
public int a, b, c = 0; //Declare them here.
public HalloForm()
{
this.Text = "Hallo";
this.BackColor = Color.Yellow;
this.Size = new Size(800, 600);
this.Paint += this.tekenScherm;
}
public static void Main()
{
System.Console.WriteLine("Smiley size, on a scale of 1 tot 10?");
a = Int32.Parse(System.Console.ReadLine());
System.Console.WriteLine("X coordinate of the smiley, on a scale of 1 to 10");
b = Int32.Parse(System.Console.ReadLine());
System.Console.WriteLine("Y coordinate of the smiley, on a scale of 1 to 10");
c = Int32.Parse(System.Console.ReadLine());
HalloForm scherm;
scherm = new HalloForm();
Application.Run(scherm);
}
void tekenScherm(object obj, PaintEventArgs pea)
{
SolidBrush blueBrush = new SolidBrush(Color.Blue);
Pen blackBrush = new Pen(Color.Black, 5);
int x = 360;
int y = x + 75;
pea.Graphics.FillEllipse(blueBrush, 300, 200, 200, 200);
pea.Graphics.DrawEllipse(blackBrush, 300, 200, 200, 200);
pea.Graphics.DrawArc(blackBrush, 350, 250, 100, 100, 45, 90);
pea.Graphics.DrawEllipse(blackBrush, x, 250, 5, 5);
pea.Graphics.DrawEllipse(blackBrush, y, 250, 5, 5);
}
}

Related

Create a Bitmap image to show an hour worked using c#

I am trying to make a Bitmap image to represent a block of one hour and show red as worked time and white as non-worked showing in periods of 10 minutes intervals. I am trying to get the result to look like below:
Any help or guidance would be greater appreciated. In the code below Tuple<int,DateTime>> the int is time block example 0,1,2,3.....21,22,23,24 and DateTime will hold the time worked.
public void DrawPeriod(IGrouping<int, Tuple<int, DateTime>> worked)
{
var bitmap = new Bitmap(640, 480);
for (var x = 0; x < bitmap.Width; x++)
{
for (var y = 0; y < bitmap.Height; y++)
{
bitmap.SetPixel(x, y, Color.Red);
}
}
bitmap.Save("worked.bmp");
}
Sorry I can't give a sample with the data you needed. But you can do it something like this. This can be achieved by using System.Drawing.Graphics.
var sampleData = new int[] { 1, 2, 3, 13, 4, 5, 6, 12, 7, 8, 9 };
var bitmapHeight = 250;
var barWidth = 50;
var bitmap = new Bitmap(sampleData.Length * barWidth, bitmapHeight);
int currentX = 1;
foreach (var item in sampleData)
{
var result = item % 2;
Brush brush;
if (result == 0)
{
brush = Brushes.Red;
}
else
{
brush = Brushes.White;
}
using (Graphics graphics = Graphics.FromImage(bitmap))
{
var rectangle = new Rectangle(currentX, 0, barWidth, bitmapHeight);
graphics.SmoothingMode = SmoothingMode.AntiAlias;
graphics.FillRectangle(brush, rectangle);
// Set Text
Font drawFont = new Font("Arial", 16);
SolidBrush drawBrush = new SolidBrush(Color.Black);
graphics.DrawString(item.ToString(), drawFont, drawBrush, currentX + 15, bitmapHeight / 2);
}
currentX = currentX + 50;
}
// Border
using (Graphics graphics = Graphics.FromImage(bitmap))
{
graphics.DrawRectangle(new Pen(Brushes.Black, 5), new Rectangle(0, 0, bitmap.Width, bitmap.Height));
}
bitmap.Save(FileName);
Sample Output

Chart: issue with stacked areas order

I would like to display the 2 different stacked area elements according to their parameters. But the chart area displays it not as specified and puts the second block at the top right corner of the first stacked area. They should be displayed side by side not stacked.
...
using System.Windows.Forms.DataVisualization.Charting;
namespace Gantt_Tool
{
public partial class ReadModel : Form
{
public ReadModel()
{
InitializeComponent();
CreateChart();
}
private void ReadModel_Load(object sender, EventArgs e)
{
}
private void CreateChart()
{
chart1.Series.Add($"a");
chart1.Series[$"a"].Points.Add(new DataPoint(0, 2));
chart1.Series[$"a"].Points.Add(new DataPoint(2, 2));
chart1.Series[$"a"].ChartType = SeriesChartType.StackedArea;
chart1.Series.Add($"b");
chart1.Series[$"b"].Points.Add(new DataPoint(2, 3));
chart1.Series[$"b"].Points.Add(new DataPoint(5, 3));
chart1.Series[$"b"].ChartType = SeriesChartType.StackedArea;
}
}
How can I set the blocks to a side by side order or placed freely? And how can I get unfilled rectangles?
Update: Here is an example of how it should look like:
From your comments, I take that you want to have a chart with freely-placed, unfilled rectangles and labels.
None of the MSChart types will do that.
Here is how to use a Point chart with a few lines of owner-drawing. Note how nicely this will behave when resizing the chart...
Here is the setup:
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
ax.Maximum = 9; // pick or calculate
ay.Maximum = 6; // minimum and..
ax.Interval = 1; // maximum values..
ay.Interval = 1; // .. needed
ax.MajorGrid.Enabled = false;
ay.MajorGrid.Enabled = false;
Series s1 = chart1.Series.Add("A");
s1.ChartType = SeriesChartType.Point;
Now we add your five boxes. I use a sepcial function that adds the points and stuffs the box size into the Tag of each point..:
AddBox(s1, 1, 0, 3, 1, "# 1");
AddBox(s1, 2, 1, 2, 2, "# 2");
AddBox(s1, 4, 0, 4, 2, "# 3");
AddBox(s1, 4, 2, 2, 2, "# 4");
AddBox(s1, 4, 4, 1, 1, "# 5");
int AddBox(Series s, float x, float y, float w, float h, string label)
{
return AddBox(s, new PointF(x, y), new SizeF(w, h), label);
}
int AddBox(Series s, PointF pt, SizeF sz, string label)
{
int i = s.Points.AddXY(pt.X, pt.Y);
s.Points[i].Tag = sz;
s.Points[i].Label = label;
s.Points[i].LabelForeColor = Color.Transparent;
s.Points[i].Color = Color.Transparent;
return i;
}
The drawing is also simple; only the use of the Axes function ValueToPixelPosition is noteworthy..:
private void chart1_PostPaint(object sender, ChartPaintEventArgs e)
{
if (chart1.Series[0].Points.Count <= 0) return;
Axis ax = chart1.ChartAreas[0].AxisX;
Axis ay = chart1.ChartAreas[0].AxisY;
Graphics g = e.ChartGraphics.Graphics;
using (StringFormat fmt = new StringFormat()
{ Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center})
foreach (Series s in chart1.Series)
{
foreach (DataPoint dp in s.Points)
{
if (dp.Tag == null) break;
SizeF sz = (SizeF)dp.Tag;
double vx2 = dp.XValue + sz.Width;
double vy2 = dp.YValues[0] + sz.Height;
int x1 = (int)ax.ValueToPixelPosition(dp.XValue);
int y1 = (int)ay.ValueToPixelPosition(dp.YValues[0]);
int x2 = (int)ax.ValueToPixelPosition(vx2);
int y2 = (int)ay.ValueToPixelPosition(vy2);
Rectangle rect = Rectangle.FromLTRB(x1, y2, x2, y1);
using (Pen pen = new Pen(s.Color, 2f))
g.DrawRectangle(pen, rect);
g.DrawString(dp.Label, Font, Brushes.Black, rect, fmt);
}
}
}
Here is a little Linq to calculate the Minimum and Maximum values for the Axes to hold just the right size; chart won't do it by itself since the size in the tags of the points is not known...
private void setMinMax(Chart chart, ChartArea ca)
{
var allPoints = chart.Series.SelectMany(x => x.Points);
double minx = allPoints.Select(x => x.XValue).Min();
double miny = allPoints.Select(x => x.YValues[0]).Min();
double maxx = allPoints.Select(x => x.XValue + ((SizeF)x.Tag).Width).Max();
double maxy = allPoints.Select(x => x.YValues[0] + ((SizeF)x.Tag).Height).Max();
ca.AxisX.Minimum = minx;
ca.AxisX.Maximum = maxx;
ca.AxisY.Minimum = miny;
ca.AxisY.Maximum = maxy;
}

Coding a class with protected variables to be access by another method

I am having problems creating a protected variable that can be access and updated by an external method.
In other words, I have got a print method that prints multiple pages.
I needs an external variable to initialize this method and keep track of the pages.
Is it possible someone could get me started in coding this class? as I knowledge on OOP is limited
Below is the print method
Thanks in advance
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{
Graphics graphics = e.Graphics;
int ypos = 78;
Font f1 = new Font("Arial", 14, FontStyle.Bold, GraphicsUnit.Pixel);
Brush brush = new SolidBrush(Color.LightSlateGray);
graphics.FillRectangle(brush, new Rectangle(10, 10, 770, 50));
Pen blackpen = new Pen(Color.Black);
Pen graypen = new Pen(Color.LightGray);
Pen redpen = new Pen(Color.Red);
graphics.DrawRectangle(blackpen, new Rectangle(10, 10, 770, 50));
Brush B = new SolidBrush(listView1.ForeColor);
graphics.DrawLine(blackpen, 10, 10, 10, 1132);
graphics.DrawString("FORENAME", f1, Brushes.Black, new Point(20, 25));
graphics.DrawLine(blackpen, 130, 10, 130, 1132);
graphics.DrawString("SURNAME", f1, Brushes.Black, new Point(140, 25));
graphics.DrawLine(blackpen, 290, 10, 290, 1132);
graphics.DrawString("EXT.", f1, Brushes.Black, new Point(300, 25));
graphics.DrawLine(blackpen, 380, 10, 380, 1132);
graphics.DrawString("JOB TITLE", f1, Brushes.Black, new Point(410, 25));
graphics.DrawLine(blackpen, 780, 10, 780, 1132);
int[] X = { 15, 140, 300, 390, 720 };
int Y = 60;
f1 = listView1.Font;
for (int I = 0; I < listView1.Items.Count; I++){
for (int J = 0; J < listView1.Items[I].SubItems.Count - 1; J++){
graphics.DrawString(listView1.Items[I].SubItems[J].Text, f1, B, X[J], Y);
}
}
Y += f1.Height;
graphics.DrawLine(graypen, 10, ypos, 780, ypos);
ypos = ypos + 17;
if (ypos > 1132){
e.HasMorePages = true;
return;
}
graphics.Dispose();
}
Try below function, and call print event
public void PrintDocument()
{
try
{
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler
(this.printDocument1_PrintPage);
pd.Print();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

Moving Smiling Face C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Below I've created a program using C# that creates a smiley face. It also moves across the screen. I cannot figure out how to get the smiley face to bounce off the edges and around the screen. Please Help. Thank you.
*/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 HappyFace
{
public partial class HappyFace : Form
{
int xpos = 0;
int ypos = 0;
int width = 0;
int length = 0;
int startAngle = 45;
int sweepAngle = 90;
public HappyFace()
{
InitializeComponent();
}
private void HappyFace_Load(object sender, EventArgs e)
{
}
private void HappyFace_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen myPen = new Pen(Brushes.Red, 7);
Pen myPen2 = new Pen(Brushes.Green, 7);
//g.DrawLine(myPen, 0, 0, 500, 500);
//g.DrawLine(myPen, 0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height);
//g.DrawLine(myPen2, 0, this.ClientRectangle.Height, this.ClientRectangle.Width, 0);
//g.DrawLine(myPen2, this.ClientRectangle.Left, this.ClientRectangle.Bottom, this.ClientRectangle.Right, ClientRectangle.Top);
int endX = this.ClientRectangle.Width;
int endY = this.ClientRectangle.Height;
//string msg = String.Format("endX = {0} endY = {1}", endX, endY);
//MessageBox.Show(msg);
int xCenter = this.ClientRectangle.Left + (this.ClientRectangle.Width / 2);
int yCenter = this.ClientRectangle.Top + (this.ClientRectangle.Height / 2);
Pen circlePen = new Pen(Brushes.Black, 9);
//g.DrawEllipse(circlePen, xCenter - 50, yCenter - 50, 100, 100);
// g.FillEllipse(Brushes.Orange, xCenter -50, yCenter - 50, 100, 100);
Font myFont = new Font("Monotype Corsiva", 43, FontStyle.Bold);
g.DrawString("Happy Face", myFont, Brushes.Aqua, 300, 25);
//g.DrawArc(circlePen, xpos, width, length, startAngle, sweepAngle);
g.DrawEllipse(circlePen, xpos, ypos + 130, 250, 250);
g.FillEllipse(Brushes.PeachPuff, xpos, ypos + 130, 250, 250);
g.DrawEllipse(circlePen, xpos + 65, ypos + 200, 20, 35);
g.FillEllipse(Brushes.Black, xpos + 65, ypos + 200, 20, 35);
g.DrawEllipse(circlePen, xpos + 160, ypos + 200, 20, 35);
g.FillEllipse(Brushes.Black, xpos + 160, ypos + 200, 20, 35);
g.DrawArc(circlePen, xpos + 60, ypos + 215, 130, 120, 35, 115);
}
private void timer1_Tick(object sender, EventArgs e)
{
xpos = xpos + 3;
if(xpos >= this.ClientRectangle.Right - 250)
{
xpos = 0;
}
this.Invalidate();
}
}
}*/
Well, I was a bit bored. I'll assume that the object is going to move in a 45 degrees trajectory,and that when it collides with the bounds it would change by 90ยบ.
What I would do (this is a very simple solution) is, first of all, define the direction in both axes in which i want the "smiley" to move,the step in each timer tick, the position of the center and the size of the object, something like:
int xpos = 0;
int ypos = 130;
int step = 10;
int width = 250;
int height = 250;
int directionX = +1;
int directionY = -1;
The timer would just increase the x and y positions:
private void timer1_Tick(object sender, EventArgs e)
{
xpos += 10*directionX;
ypos += 10*directionY;
checkBounds(); //This would check if the object collides with the bounds
this.Invalidate();
}
The checkBounds method check if the object collides with the bounds:
private void checkBounds()
{
if (ypos < 0 + step || ypos + height+ step > ClientRectangle.Height)
{
directionY *= -1;
}
if (xpos < 0 + step || xpos + width + step > ClientRectangle.Width)
{
directionX *= -1;
}
}
Finally, the Paint method is similar to yours, just adjusting some values:
private void Form2_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen myPen = new Pen(Brushes.Red, 7);
Pen myPen2 = new Pen(Brushes.Green, 7);
int endX = this.ClientRectangle.Width;
int endY = this.ClientRectangle.Height;
int xCenter = this.ClientRectangle.Left + (this.ClientRectangle.Width / 2);
int yCenter = this.ClientRectangle.Top + (this.ClientRectangle.Height / 2);
Pen circlePen = new Pen(Brushes.Black, 9);
Font myFont = new Font("Monotype Corsiva", 43, FontStyle.Bold);
g.DrawString("Happy Face", myFont, Brushes.Aqua, 300, 25);
g.DrawEllipse(circlePen, xpos, ypos, 250, 250);
g.FillEllipse(Brushes.PeachPuff, xpos, ypos, 250, 250);
g.DrawEllipse(circlePen, xpos + 65, ypos -130 + 200, 20, 35);
g.FillEllipse(Brushes.Black, xpos + 65, ypos-130 + 200, 20, 35);
g.DrawEllipse(circlePen, xpos + 160, ypos-130 + 200, 20, 35);
g.FillEllipse(Brushes.Black, xpos + 160, ypos-130 + 200, 20, 35);
g.DrawArc(circlePen, xpos + 60, ypos-130 + 215, 130, 120, 35, 115);
}
This code could be highly improved, but this may help you think how it should be done. Hope it helps.

Using trackbars to display and distort a cross section

The question asked to calculate the volume of a swimming pool and display its cross section in a picture box. Width of the pool is fixed at 5 meters and the length is fixed at 20 meters.
The program should have 2 trackbars - one to adjust the depth of the deep end and one to adjust the depth of the shallow end. The minimum depth of each end is one meter, choose suitable maximum and minimum track bar values at design time.
Volume = averageDepth * width * length
The trackbar for the deep end of the pool adjusts the depth perfectly.
The trackbar for the shallow end changes the cross section and does not diplay one of the lines when used.
Could someone please help me correct this and figure it out?
Heres the code:
public partial class Form1 : Form
{
private Graphics paper;
private int averageDepth;
private int answer;
public Form1()
{
InitializeComponent();
paper = pictureBox1.CreateGraphics();
deepEndTrackbar.Minimum = 120;
deepEndTrackbar.Maximum = 180;
deepEndLabel.Text = Convert.ToString(deepEndTrackbar.Value);
shallowEndTrackbar.Minimum = 120;
shallowEndTrackbar.Maximum = 180;
shallowEndLabel.Text = Convert.ToString(shallowEndTrackbar.Value);
}
private void button1_Click(object sender, EventArgs e)
{
Graphics paper;
paper = pictureBox1.CreateGraphics();
Pen pen = new Pen(Color.Black);
paper.DrawLine(pen, 40, 50, 200, 50);
paper.DrawLine(pen, 40, 50, 40, 120);
paper.DrawLine(pen, 200, 50, 200, 90);
paper.DrawLine(pen, 200, 90, 40, 120);
}
private void deepEndTrackbar_Scroll(object sender, EventArgs e)
{
Pen pen = new Pen(Color.Black);
deepEndLabel.Text = Convert.ToString(deepEndTrackbar.Value);
paper.Clear(Color.White);
paper.DrawLine(pen, 40, 50, 200, 50);
paper.DrawLine(pen, 200, 50, 200, 90);
paper.DrawLine(pen, 40, 50, 40, deepEndTrackbar.Value);
paper.DrawLine(pen, 200, 90, 40, deepEndTrackbar.Value);
}
private void shallowEndTrackbar_Scroll(object sender, EventArgs e)
{
Pen pen = new Pen(Color.Black);
shallowEndLabel.Text = Convert.ToString(shallowEndTrackbar.Value);
paper.Clear(Color.White);
paper.DrawLine(pen, 40, 50, 200, shallowEndTrackbar.Value);
paper.DrawLine(pen, 200, 50, 200, shallowEndTrackbar.Value);
}
The deepEndTrackbar_Scroll routine seems to work. But it doesn't really as it does not use the value of the shallowEndTrackbar. In fact both routines should draw the very same lines:
paper.DrawLine(pen, 40, 50, 200, 50);
paper.DrawLine(pen, 200, 50, 200, shallowEndTrackbar.Value);
paper.DrawLine(pen, 40, 50, 40, deepEndTrackbar.Value);
paper.DrawLine(pen, 200, shallowEndTrackbar.Value, 40, deepEndTrackbar.Value);
This is the bare minimum correction.
The next step would be to have this code only once. The direct solution would be to call the same event for both Trackbars.
However all these things are only working on the surface. Minimize the window, restore and look: All Lines are gone! You need to persist the drawing!
The right place for the code is the Paint event of the PictureBox. You could override it, but it is simpler to just code it: Doubleclick it in the properties tab and insert the code.
Prefix this line to the code:
paper = e.Graphics;
And replace all drawing in the two TrackBar scroll events for this:
pictureBox1.Invalidate();
Another error is with initializing the Trackbar. Judging from the initial display one value (90) is not in the allowed range (120-180).
You also don't need the lines
private Graphics paper;
and
paper = pictureBox1.CreateGraphics();
Edit: As requested here is a complete solution.
Note: I have added a LengthTrackbar and moved the drawing down by 100 pixels:
public partial class Form1 : Form
{
Pen pen = Pens.Black;
//private int averageDepth;
//private int answer;
public Form1 ()
{
InitializeComponent();
deepEndTrackbar.Minimum = 120;
deepEndTrackbar.Maximum = 180;
deepEndLabel.Text = Convert.ToString(deepEndTrackbar.Value);
shallowEndTrackbar.Minimum = 120;
shallowEndTrackbar.Maximum = 180;
shallowEndLabel.Text = Convert.ToString(shallowEndTrackbar.Value);
lengthTrackbar.Minimum = 120;
lengthTrackbar.Maximum = 180;
lengthLabel.Text = Convert.ToString(lengthTrackbar.Value);
}
private void button1_Click(object sender, EventArgs e)
{
// reset the trackbar values:
shallowEndTrackbar.Value = 120;
deepEndTrackbar.Value = 120;
lengthTrackbar.Value = 120;
pictureBox1.Invalidate();
}
private void deepEndTrackbar_Scroll(object sender, EventArgs e)
{
deepEndLabel.Text = Convert.ToString(deepEndTrackbar.Value);
pictureBox1.Invalidate();
}
private void shallowEndTrackbar_Scroll(object sender, EventArgs e)
{
shallowEndLabel.Text = Convert.ToString(shallowEndTrackbar.Value);
pictureBox1.Invalidate();
}
private void lengthTrackbar_Scroll(object sender, EventArgs e)
{
lengthLabel.Text = Convert.ToString(lengthTrackbar.Value);
pictureBox1.Invalidate();
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics paper = e.Graphics;
// reset the paper
paper.Clear(Color.White);
// draw the 2D front lines:
paper.DrawLine(pen, 40, 150, 200, 150);
paper.DrawLine(pen, 200, 150, 200, 100 + shallowEndTrackbar.Value);
paper.DrawLine(pen, 40, 150, 40, 100 + deepEndTrackbar.Value);
paper.DrawLine(pen, 200, 100 + shallowEndTrackbar.Value, 40,
100 + deepEndTrackbar.Value);
// perspective 2:3
int lx = lengthTrackbar.Value / 2;
int ly = lengthTrackbar.Value / 3;
// draw the outer 3D lines:
paper.DrawLine(pen, 40, 150, 40 + lx, 150 - ly);
paper.DrawLine(pen, 200, 150, 200 + lx, 150 - ly);
paper.DrawLine(pen, 200, 100 + shallowEndTrackbar.Value,
200 + lx, 100 - ly + shallowEndTrackbar.Value);
paper.DrawLine(pen, 40 + lx, 150 - ly, 40 + lx + 200 - 40, 150 - ly);
paper.DrawLine(pen, 200 + lx, 150 - ly,
200 + lx, 100 -ly + shallowEndTrackbar.Value);
}
}

Categories

Resources