Author Topic: Rotate by 45 degree  (Read 1230 times)

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Rotate by 45 degree
« on: January 18, 2021, 11:31:56 AM »
Hi,

need to display object like on attached picture. Every rectangle inside of blue squere rotated by 45 degree, have own plc address and 3 colors which need to change by value (0-black 1-green 2-red). What object i need to use and how to rotate rectangle by 45 degrees, maybe basic label or ....

Thank you

MajorFault

  • Guest
Re: Rotate by 45 degree
« Reply #1 on: January 18, 2021, 01:43:40 PM »
AHMI, which is WinForms, doesn't play nice with graphics.  The BasicShape will get you close, but that doesn't allow rotation.  Your best bet is draw without angles.  If you must do angles (45), then the only way I know is to draw in code.

https://stackoverflow.com/questions/18402311/draw-rotated-rectangle
https://www.codeproject.com/Questions/125240/Rotating-Rectangle

Once you have it drawn, you can make the backcolor any color you want based on a PLC value.

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Rotate by 45 degree
« Reply #2 on: January 19, 2021, 06:12:19 AM »
I think i will just leave that graphics on 90° and wont bother anymore with rotation.
Thank you anyway.