Hi,
I’m not able to display an image for GoIconicNode.
In the IconicApp example the images were stored in a resx file.
I want to display the images directly from the webfolder, so I use the following code:
GoImage.DefaultResourceManager = null;
GoIconicNode iconNode = new GoIconicNode();
iconNode.Initialize(null, “Go.ico”, “Go”);
iconNode.Icon.Size = new SizeF(20, 20);
iconNode.Location = new PointF(100, 100);
MyView.Document.Add(iconNode);
Since the GoImage.DefaultResourceManager is null it should look in my webfolder for the image right? For some strange reason this doesn’t work. Can somebody help me?
You should use the Web Forms TemplateSourceDirectory property to construct the path to your disk files.
I don’t get it. The icon isn’t stored in an image map. I stored it in the same directory as my testcode. So I shouldn’t need to use the Web Forms TemplateSourceDirectory property.
However if I change my code to:
iconNode.Initialize(null, MapPath(this.TemplateSourceDirectory) + “/Go.ico”, “Go”);
it works.
Isn’t it strange that I need to put the MapPath function in front of my icon name? Shouldn’t the initialize function do that for me?
Thanks for your supoport.
If the GoIconicNode.Initialize method automatically prefixed the argument string with anything, it would hinder you from specifying files in other locations or might accidentally find other files.