Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SvgContent.DrawImage() always returns null (Read 777 times)
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 112
Joined: Aug 25th, 2022
SvgContent.DrawImage() always returns null
Nov 1st, 2023 at 6:58am
Print Post  
Hello, Mindfusion team. I need to draw SvgNode by using both Content and Image properties, but proccess of creating a bitmap from SvgContent by using third-party library is slow. As I see there are some SvgContent.DrawImage() methods, but they always return null. Do you have plans on implementation of these methods?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3303
Joined: Oct 19th, 2005
Re: SvgContent.DrawImage() always returns null
Reply #1 - Nov 2nd, 2023 at 6:04am
Print Post  
Hi,

If you mean you need to create a bitmap file from SVG, you could pass the RenderTargetBitmap from this post to a BitmapEncoder -

https://mindfusion.eu/Forum/YaBB.pl?num=1674016481/1#1


Code
Select All
var bitmapEncoder = new PngBitmapEncoder();
bitmapEncoder.Frames.Add(
    BitmapFrame.Create(renderTargetBitmap));
bitmapEncoder.Save(stream); 


https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.imaging.bitmap...

We'll have in mind adding built-in method for next release.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint