Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null reference exception in Draw function. #64

Closed
LuckasCzygier opened this issue Apr 23, 2014 · 4 comments · Fixed by #290
Closed

Null reference exception in Draw function. #64

LuckasCzygier opened this issue Apr 23, 2014 · 4 comments · Fixed by #290

Comments

@LuckasCzygier
Copy link

at Svg.SvgElementIdManager.GetElementById(Uri uri) in c:\Dev\vvvv\SVG\Source\SvgElementIdManager.cs:line 42
at Svg.SvgUse.Render(SvgRenderer renderer) in c:\Dev\vvvv\SVG\Source\Document Structure\SvgUse.cs:line 85
at Svg.SvgElement.RenderChildren(SvgRenderer renderer) in c:\Dev\vvvv\SVG\Source\SvgElement.cs:line 572
at Svg.SvgElement.Render(SvgRenderer renderer) in c:\Dev\vvvv\SVG\Source\SvgElement.cs:line 560
at Svg.SvgDocument.Draw(Bitmap bitmap) in c:\Dev\vvvv\SVG\Source\SvgDocument.cs:line 386
at Svg.SvgDocument.Draw() in c:\Dev\vvvv\SVG\Source\SvgDocument.cs:line 359
at IconBuilder.IconBuilderControl.LoadImages() in k:\src.lukasz.czygier\WMD\WMD\IconBuilder\IconBuilderControl.cs:line 142
at IconBuilder.IconBuilderControl..ctor() in k:\src.lukasz.czygier\WMD\WMD\IconBuilder\IconBuilderControl.cs:line 75
at ControlTestApp.Icons.InitializeComponent() in c:\Users\luczpl\Documents\Visual Studio 2012\Projects\ControlTestApp\ControlTestApp\Form1.Designer.cs:line 43
at ControlTestApp.Icons..ctor() in c:\Users\luczpl\Documents\Visual Studio 2012\Projects\ControlTestApp\ControlTestApp\Form1.cs:line 18
at ControlTestApp.Program.Main() in c:\Users\luczpl\Documents\Visual Studio 2012\Projects\ControlTestApp\ControlTestApp\Program.cs:line 19
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Having problems with drawing some SVG's. Can I send them to test?

@tobiasoort
Copy link

Put them online somewhere (like pastebin) and link them here.

@LuckasCzygier
Copy link
Author

http://pastebin.com/NmRSdtWr
http://pastebin.com/r5MPA2YN

Can You draw them?

Stream str=(this.GetType().Assembly.GetManifestResourceStream(resourceName));

              SvgDocument svgDoc = SvgDocument.Open<SvgDocument>(str, null);

                svgDoc.Draw();

Same drawing from file (src, not stream)

@LuckasCzygier
Copy link
Author

Problem uccurs in method:
protected virtual void Render(SvgRenderer renderer)
{
this.PushTransforms(renderer);
this.RenderChildren(renderer); //here
this.PopTransforms(renderer);
}

protected virtual void RenderChildren(SvgRenderer renderer)
{
foreach (SvgElement element in this.Children)
{
element.Render(renderer);
}
}

I have 1 element in collection (SvgUse) which cannot be drawn. Can you help me?

@gianpaolocunha
Copy link

Is anyone took a look on that ?

mrbean-bremen added a commit to mrbean-bremen/SVG that referenced this issue Mar 7, 2017
- fixed matrix order (Prepend instead of Append)
- fixes svg-net#64 (see __issue-064-01.svg and __issue-064-02.svg)
- fixes test for struct-use-03-t.svg
mrbean-bremen added a commit to mrbean-bremen/SVG that referenced this issue Mar 7, 2017
- fixed matrix order (Prepend instead of Append)
- fixes svg-net#64 (see __issue-064-01.svg and __issue-064-02.svg)
- fixes test for struct-use-03-t.svg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants