Trouble with displaying the picturebox on real flexpendant
egor
✭
Hi,
I have a problem with displaying the picturebox on real flexpendant. On the virtual controller the picture is displayed without any problems (see MainScreen.png) . And that's what happens in reality (real.jpg). I have nothing idea how to fix it. I use picturebox from flexpendant toolbox.
Here's my code:
I have a problem with displaying the picturebox on real flexpendant. On the virtual controller the picture is displayed without any problems (see MainScreen.png) . And that's what happens in reality (real.jpg). I have nothing idea how to fix it. I use picturebox from flexpendant toolbox.
Here's my code:
private void disk()
{
pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height);
using (Graphics g = Graphics.FromImage(pictureBox1.Image))
{
g.DrawEllipse(new Pen(Color.Black, 4), 0, 0, 277, 277);
g.FillEllipse(new SolidBrush(Color.AliceBlue), 0, 0, 277, 277);
g.DrawEllipse(new Pen(Color.Black, 4), (277 - 47) / 2, (277 - 47) / 2, 47, 47);
g.FillEllipse(new SolidBrush(Color.White), (277 - 47) / 2, (277 - 47) / 2, 47, 47);
}
pictureBox1.Refresh();
}
private void rectangle()
{
for (int i = 1; i < k; i++)
{
for (int j = 1; j < m; j++)
{
//some logic here
if (l1 < D / 2 && l2 < D / 2 && l3 < D / 2 && l4 < D / 2 && l1 > d / 2 && l2 > d / 2 && l3 > d / 2 && l4 > d / 2)
{
using (Graphics g = Graphics.FromImage(pictureBox1.Image))
{
RectangleF myRectangleF = new RectangleF(x1 , y1 , b, h);
Rectangle truncatedRectangle = Rectangle.Truncate(myRectangleF);
g.DrawRectangle(new Pen(Color.DodgerBlue), truncatedRectangle);
SolidBrush Brush = new SolidBrush(Color.DodgerBlue);
g.FillRectangle(Brush, truncatedRectangle);
}
}
pictureBox1.Refresh();
}
}
}
0
Best Answer
-
Solve my problem using picturebox from the standart windows toolbox.0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings