why all image is black? #856
Replies: 13 comments
-
What OS and framework are you using? |
Beta Was this translation helpful? Give feedback.
-
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)? |
Beta Was this translation helpful? Give feedback.
-
i use windows and dotnet core |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks! |
Beta Was this translation helpful? Give feedback.
-
Can you upload the real svg (not the png image) to be able to reproduce this? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Thanks - I will have a closer look later! |
Beta Was this translation helpful? Give feedback.
-
Thanks! @mrbean-bremen |
Beta Was this translation helpful? Give feedback.
-
Ok, I checked your image, and get the same result, though I'm not sure what you want to accomplish with this code. |
Beta Was this translation helpful? Give feedback.
-
I have same question,my background of svg is transparent. But it's changes to black background. How could I do,thanks. |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
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); |
Beta Was this translation helpful? Give feedback.
-
Description
All image is black.
Example data
Used Versions
used Version: 2.4.3
Beta Was this translation helpful? Give feedback.
All reactions