Hi,

On 22 Dec 2004, at 8:37, Siva Chandra wrote:
What exactly does the close() function do? For
example, I might want to create a temporary image, ie.
a temporary instance of pngwriter, but I do not want
to save this image to a file. So then, can I just skip
calling the close() function.

Yes, that is correct. All it does is go through the process of writing the file. You can call close(), modify the file (with plot() ), rename the file (with pngwriter_rename() ) and close() the instance again, and you'll have two different png files waiting for you.


Also, if I just want to create an image(again, an
instance of pngwriter) which I do not intend to save
to a file, then which constrcutor should I use for
such purposes?

Any you want, really, it is irrelevant. Here are the constructors available:


1 pngwriter();
2 pngwriter(const pngwriter &rhs);
3 pngwriter(int width, int height, int backgroundcolour, char * filename);
4 pngwriter(int width, int height, double backgroundcolour, char * filename);
5 pngwriter(int width, int height, int backgroundcolour, const char * filename);
6 pngwriter(int width, int height, double backgroundcolour, const char * filename);


You may or may not know the size of the image. If you do, use any of 3 to 6. If you don't, you can either use 1 (the default constructor creates a PNGwriter instance that is 250x250, white background, and filename "out.png"), though this is not too efficient, or again any of 3 to 6, but with width and height set to 1 pixel. When you do finally know what size the image will be, you would then use resize().

 I do not intend to create an image by
reading from an existing file either!

That is not a problem, as the only time you use an existing file is when you use readfromfile().


Or, is it that both the above tasks are not possible?

They are quite possible! I hope I answered your questions.

Cheers,

Paul Blackburn




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
http://pngwriter.sourceforge.net/
PNGwriter-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pngwriter-users

Reply via email to