Insert text into images

1

I have a Switch that according to the given status it throws an image, however I would like to also play the numbering of this status in the image (that text that usually when we click on the image it appears). I wonder if there is any property that does this. Here is the code that I did.

          switch (codParc)
                {
                    case 1:
                        imgStats.ImageUrl = "../images/yellowStatus.png";
                        break;
                    case 2:
                        imgStats.ImageUrl = "../images/yellowStatus.png";
                        break;
                    case 4:
                        imgStats.ImageUrl = "../images/greenStatus.png";
                        break;
                    default:
                        imgStats.ImageUrl = "../images/neutralStatus.png";
                        break;
                }

To get a sense of what the image has to look like, it would look something like this:

    
asked by anonymous 04.03.2016 / 19:58

2 answers

0

By improving the peer-response by peer feedback and peer feedback, the code looks like this:

switch (codParc)
                {
                    case 1:
                        imgStats.ImageUrl = "../images/yellowStatus.png";
                        imgStats.ToolTip = "1";
                        break;
                    case 2:
                        imgStats.ImageUrl = "../images/yellowStatus.png";
                        imgStats.ToolTip = "2";
                        break;
                    case 4:
                        imgStats.ImageUrl = "../images/greenStatus.png";
                        imgStats.ToolTip = "4";
                        break;
                    default:
                        imgStats.ImageUrl = "../images/neutralStatus.png";
                        break;
                }

Where the status text is generated according to the Switch.

    
04.03.2016 / 20:30
2

The ToolTip does what you need, here's an example of how it would look without the Switch.

<asp:Image ID="Imagem1" runat="server"
       AlternateText="Smiley Face"
       ImageAlign="left"
       ToolTip="Status da numeração"
       ImageUrl="../images/yellowStatus.png" />
    
04.03.2016 / 20:21