youcef92 / flotr

Automatically exported from code.google.com/p/flotr
0 stars 0 forks source link

Add backgroundColor option to the canvas #161

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I added a backgroundColor option to the Canvas.

The reason was that saving something with a transparent background to a BMP 
caused a black background to be in the canvas area.

Original issue reported on code.google.com by justin.f...@gmail.com on 14 Dec 2010 at 10:38

Attachments:

GoogleCodeExporter commented 8 years ago
Is the backgroundColor sub-option for the "grid" option not okay in some way?

If it is, you can just use that, instead

Original comment by peter....@solide-ict.nl on 2 Feb 2011 at 1:26

GoogleCodeExporter commented 8 years ago
The reason is that when you "make the graph an image" and capture it as a BMP, 
the background of the canvas is black because BMP can't do transparent.
So I needed to be able to color the background of the canvas white so that when 
I took a BMP, it looked correct.

The background sub-option for the grid is necessary, but not sufficient because 
the area of the canvas that is outside of the grid is still transparent, and 
thus becomes black on a BMP.

Thanks,

Justin

Original comment by justin.f...@gmail.com on 2 Feb 2011 at 4:58

GoogleCodeExporter commented 8 years ago
In fact BMP supports transparency, and the graphs are saved with this 
transparency (if I remember correctly), but not all the BMP viewers support 
transparency.
I strongly recommend not to use BMP which is really heavy and use PNG. What is 
the reason for this?
The option grid.backgroundColor is the way to go anyway.

Original comment by fabien.menager on 2 Feb 2011 at 5:35

GoogleCodeExporter commented 8 years ago
I agree with Fabien

Original comment by peter....@solide-ict.nl on 3 Feb 2011 at 9:04