Repository navigation
why all image is black? #856
Replies: 13 comments
|
What OS and framework are you using? |
|
Ah, you are drawing a completely transparent bitmap - are you sure your png is black and not transparent (it will look black in some viewers like IrfanView)? |
|
i use windows and dotnet core |
|
Ok, thanks! |
|
Can you upload the real svg (not the png image) to be able to reproduce this? |
|
|
|
Thanks - I will have a closer look later! |
|
Ok, I checked your image, and get the same result, though I'm not sure what you want to accomplish with this code. |
|
I have same question,my background of svg is transparent. But it's changes to black background. How could I do,thanks. |
|
Same issue here, can anybody point in the right direction on how to make transparent background turn to white instead of black when saving to PNG? |
|
Fill white in advance. var size = svgDoc.GetDimensions();
var image = new System.Drawing.Bitmap((int)Math.Round(size.Width), (int)Math.Round(size.Height));
using (var g = System.Drawing.Graphics.FromImage(image))
using (var brush = new System.Drawing.SolidBrush(System.Drawing.Color.White))
{
g.FillRectangle(brush, 0, 0, image.Width, image.Height);
}
svgDoc.Draw(image); |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
All image is black.
Example data
Used Versions
used Version: 2.4.3
All reactions