in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Webchart output in other formats

Last post 03-17-2008 4:40 PM by mharen. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-13-2008 2:28 PM

    • mharen
    • Not Ranked
    • Joined on 03-13-2008
    • Posts 3

    Webchart output in other formats

    I have build a page graph.aspx, which streams a chart to other pages. That is, other pages include it with img tags and set the img src="graph.aspx?config=blah". I accomplished this using the suggested modification from another thread:

    Public Class InheritedWebChart
        Inherits C1.Web.C1WebChart.C1WebChart

        Public Function MyGetImage(ByVal ImgFormat As Imaging.ImageFormat) As System.Drawing.Image
            ' get size from the base class
            ' assuming that width/height are in pixels
            Dim sz As Size = New Size(Width.Value, Height.Value)
            Return GetImage(ImgFormat, sz)
        End Function
    End Class

     

    However, when I try to output to anything other than jpeg, I just get a red X and no image. This is (hopefully) the relevant code:


            Dim img As System.Drawing.Image = chrtSOL.MyGetImage(System.Drawing.Imaging.ImageFormat.Png)

            Response.ContentType = "image/png"
            img.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png)

    Again, if I change those Pngs to Jpgs, it works. I also tried this: I hard coded the MyGetImage reference to PNG and it gave me a JPG anyway!

    My C1WebChart dll reports its version as 1.0.20052.15115.

     

    Any ideas?

  • 03-15-2008 11:10 AM In reply to

    • mharen
    • Not Ranked
    • Joined on 03-13-2008
    • Posts 3

    Re: Webchart output in other formats

     No takers?

  • 03-17-2008 4:40 PM In reply to

    • mharen
    • Not Ranked
    • Joined on 03-13-2008
    • Posts 3

    Re: Webchart output in other formats

    Problem solved! One of my coworkers came across this solution: http://www.west-wind.com/WebLog/posts/8230.aspx

     

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.