Author Topic: GraphicIndicator image rotation  (Read 4455 times)

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
GraphicIndicator image rotation
« on: June 08, 2016, 01:24:54 PM »
The ability to rotate the 3 images during development.  It would help in development time and overall size of the compiled project because you would not need to have multiple versions on the same image at different angles (depending on the need).

For example:
I created a image of a valve.  In some places I need the valve to be shown vertically and in other places it need to be shown horizontally (depending on the flow and physical space on the Form).  Currently I need to have a minimum of 4 images (2 for each rotation to show status On/Off).

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: GraphicIndicator image rotation
« Reply #1 on: June 09, 2016, 11:45:43 AM »
I created a GraphicIndicator that will allow you to rotate the image.
Additional Properties included: Rotation, MinimumHoldTime, ShowThrough and TransparentColor.
   
Depending on what version you are running, you may have to change
SubScriptions.ComComponent   To   SubScriptions.CommComponent
« Last Edit: June 10, 2016, 02:56:24 PM by Morgan »

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: GraphicIndicator image rotation
« Reply #2 on: June 10, 2016, 02:58:37 PM »
Here is a variation that simulates movement by switching between two images.
« Last Edit: June 10, 2016, 03:27:22 PM by Morgan »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: GraphicIndicator image rotation
« Reply #3 on: June 14, 2016, 10:11:44 AM »
You actually beat me to this. I made an update to the GraphicIndicator to give it an Rotation property. This update is part of the latest release 3.99j

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: GraphicIndicator image rotation
« Reply #4 on: June 14, 2016, 12:51:40 PM »
I checked it out and I'm glad you included it but I am not sure why put limits on it by only allowing 90º increments.  It doesn't help if I have a screw auger that needs to be shown at 60º.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: GraphicIndicator image rotation
« Reply #5 on: June 14, 2016, 12:58:38 PM »
The difficulty with setting any angle was when using Stretch for the SizeMode. When it stretches at other than a 90 angle, where should it position in the region? How do you stretch X and Y?

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: GraphicIndicator image rotation
« Reply #6 on: June 14, 2016, 01:38:59 PM »
You can look at the control I posted here.  It does not limit the angle.  Feel free to plagiarize, it won't bother me at all.

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: GraphicIndicator image rotation
« Reply #7 on: June 14, 2016, 11:56:27 PM »
Hi Morgan, I loaded you're control and it looks nice.  However it seems the image does not rotate from the same anchor point.  For example the image rotates down from the left with a value of 1-90 degrees.  I cant seem to rotate up from the left anchor.  I would like to use this to show electrical oneline animation.  Also what field causes the rotation?  Thanks

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: GraphicIndicator image rotation
« Reply #8 on: June 15, 2016, 09:09:00 AM »
The GraphicIndicatorRotate control was not created for animation (see the first post).  There already is a standard control that does animation (AnimatingPictureBox) although I have not used it.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: GraphicIndicator image rotation
« Reply #9 on: August 22, 2016, 11:19:32 AM »
This topic also shows possible code for image rotation:

http://advancedhmi.com/forum/index.php?topic=1429.0