{"id":4289,"date":"2014-03-30T09:43:30","date_gmt":"2014-03-30T09:43:30","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/finding-the-path-of-an-image-file-inside-a-monomac-project-collection-of-common-programming-errors\/"},"modified":"2014-03-30T09:43:30","modified_gmt":"2014-03-30T09:43:30","slug":"finding-the-path-of-an-image-file-inside-a-monomac-project-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/finding-the-path-of-an-image-file-inside-a-monomac-project-collection-of-common-programming-errors\/","title":{"rendered":"Finding the path of an image file inside a monomac project-Collection of common programming errors"},"content":{"rendered":"<p>I am new to mono and monomac and i got stuck with something that i hope should be really easy to fix.<\/p>\n<p>In my application i want to change some images at runtime, so i created an &#8220;Images&#8221; folder with my pics inside the root of the project. But when i try to change the image in my code the image can&#8217;t be found, so i think i&#8217;m writing the wrong path.<\/p>\n<p>I try to get the image like this:<\/p>\n<pre><code>NSImage image = new NSImage(\"Images\/image2.jpg\"); \/\/ I tried with different paths but nothing changed...\npic1.Image = image;\n<\/code><\/pre>\n<p>If i use the full path to the image, everything work fine, but i need to use a relative one. How should i get the right relative path?<\/p>\n<p>I&#8217;m using Monodevelop.<\/p>\n<p>Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am new to mono and monomac and i got stuck with something that i hope should be really easy to fix. In my application i want to change some images at runtime, so i created an &#8220;Images&#8221; folder with my pics inside the root of the project. But when i try to change the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4289","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4289"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4289\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}