Solved

Write An Image Created By A Charting Class To A Bitmap File

Posted on 2004-10-29
215 Views
Last Modified: 2009-12-21
Hi

I have a barchart created by the chartdirector program available as a stream of bits that I then print using the print php statement, viz.:

print($c->makeChart2(PNG));

With the makechartChart2 being the operation of the barcharting class.

I do not have the GD graphics library loaded but need to find some way to save the stream of bits as a file so that I can later make it available to a class (part of the fpdf library) that can insert the image as a picture in a pdf document.

Does anybody have a solution.?

Help would be appreciated.
Thanks
phpamble
0
Question by:phpamble
    2 Comments
     
    LVL 48

    Accepted Solution

    by:
    If you print the content, why not just saving the content to a variable like this:
    $pic = $c->makeChart2(PNG);

    // output bits
    print $pic;

    //write pic to file:
    $fp = fopen('/name/of/pic.png', 'w+');
    fputs($fp, $pic);
    fclose($fp);
    0
     
    LVL 1

    Author Comment

    by:phpamble
    hernst42

    Thank you very much for your excellent assistance.  I also increased the point value for this question.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now