Poll

How do I get the other objects to show through an AnimatedPictureBox

Yes, it can.
2 (100%)
No, it can not.
0 (0%)

Total Members Voted: 2

Author Topic: AnimatedPictureBox Transparences  (Read 1887 times)

BarryH

  • Newbie
  • *
  • Posts: 1
    • View Profile
AnimatedPictureBox Transparences
« on: February 06, 2015, 04:15:56 PM »
Hello, I am new to Advanced HMI, it looks to be a very useful & stable development package.

I have a question about the AnimatedPictureBox. I made a simple gauge with a needle and it works great. The next part was to add a second needle to show a (programmable) set point, I inserted another AnimatedPictureBox with the BackColor set to Transparent, but the first AnimatedPictureBox would not show through.  I try with and without a BackgroundImage, and with the same PNG file in a GraphicIndicator the back will object show through, any ideas?

Thanks, this is a great product,
Barry H

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: AnimatedPictureBox Transparences
« Reply #1 on: February 06, 2015, 04:49:17 PM »
AdvancedHMI is based on winforms and unfortunately winforms doesn't play very well with stacked controls. Probably the only way to get a gauge with 2 needles would require creating a custom control which takes a good knowledge of .NET and GDI+

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: AnimatedPictureBox Transparences
« Reply #2 on: February 06, 2015, 11:00:54 PM »
Here is what I've tried:

1) Drop a panel on the form, set its size to 200x200 / BackgroundImage to RoundMeterBackground.png / BackgroundImageLayout to Stretch
2) Drop an AnimatingPictureBox on the form, set its size to 200x200, don't set BackgroundImage but set the Image to RoundMeterNeedle.png and other settings from this post http://advancedhmi.com/forum/index.php?topic=585.0
3) Either drop another AnimatingPictureBox on the form and set it as you wish or create a copy of the AnimatingPictureBox you just created in the previous step and possibly change its PLCAddressImageRotationValue address and the scale max values
4) Move the first AnimatingPictureBox to the panel and then do the same with the second AnimatingPictureBox
5) In the MainForm Load event put this line:
Code: [Select]
AnimatingPictureBox1.Controls.Add(AnimatingPictureBox2)

Check the attached pictures for the start and the end result.

I just did a quick test and it appears to be working fine. Tried the same scale for both with max value of 30000, 1st needle responding to N7:0 and the 2nd needle responding to N7:1 which was just (N7:0 value + 5000). Also tried different scales with max of 30000 for N7:0 and 1200 for T4:0.ACC and the needles were independently moving from each other.

Not sure if this is 100% what you were looking for.
« Last Edit: February 06, 2015, 11:28:52 PM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: AnimatedPictureBox Transparences
« Reply #3 on: February 17, 2016, 04:20:17 PM »
Archie,

Would you be able to create a few more RoundMeterNeedle.png images but with different colors?

For this particular topic and the example provided, it would allow to diferentiate between the 2 gauges.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: AnimatedPictureBox Transparences
« Reply #4 on: February 17, 2016, 06:19:41 PM »
Below is a link you can download the source graphic vector file of that meter. You can edit it in either Adobe Illustrator or Inkscape. It consists of 3 layers. You just hide various layers, then export to PNG to get the various images.

http://www.advancedhmi.com/RoundMeter.eps

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: AnimatedPictureBox Transparences
« Reply #5 on: February 17, 2016, 10:40:02 PM »
Here is a few more different color needle files.