locked
Question on decoding the ImageData infomation in the PMService.asmx GetIndicator method. RRS feed

  • Question

  • Does anyone know how to translate the data in the Indicator.IndicatorBands[].ImageData property of the Indicator object returned by the PMService GetIndicator method?

    I'm attempting to display individual KPIs that a user has selected from a scorecard, and need to show the appropriate indicator image.  My thoughts were to create a handler that could retrieve the above ImageData and stream it to an image control in a web part.

    Any help on this would be appreciated.
    Monday, July 13, 2009 4:30 PM

Answers

  • I actually found the problem.  The ImageData is stored as as Base46 encoded string.  To render the image:

    Byte[] IndicatorImage = Convert.FromBase64String(IndicatorObject.IndicatorBands[i].ImageData);

    context.Response.ContentType = "image/gif";
    context.Response.BinaryWrite(IndicatorImage);
    context.Response.Flush();


    Where [i] indicates the band of the indicator containing the image you want to show.

    Also, I'm doing this within an ASHX handler so my image tag on my rendering web part can point to the ashx via the NavigateUrl.

    • Marked as answer by B Starr Wednesday, July 15, 2009 3:57 PM
    Wednesday, July 15, 2009 3:56 PM