{"id":2609,"date":"2016-07-13T12:51:34","date_gmt":"2016-07-13T12:51:34","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=2609"},"modified":"2016-07-13T13:12:21","modified_gmt":"2016-07-13T13:12:21","slug":"raspidmx-pngview","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/display\/dispmanx-api\/raspidmx-pngview","title":{"rendered":"raspidmx pngview"},"content":{"rendered":"<p>\nLoads a png image file and display it as a Dispmanx layer.\n<\/p>\n<h4>\nInstalling&nbsp;raspidmx<br \/>\n<\/h4>\n<p>\nraspidmx is a library created by&nbsp;AndrewFromMelbourne&nbsp;that leaverages&nbsp;some of the capabilities of the&nbsp;Dispmanx API. &nbsp;Its a great starting point for anyone wishing to learn the&nbsp;Dispmanx API which is very poorly documented.\n<\/p>\n<p>\nSee the library homepage at&nbsp;<a href=\"https:\/\/github.com\/AndrewFromMelbourne\/raspidmx\">https:\/\/github.com\/AndrewFromMelbourne\/raspidmx<\/a>\n<\/p>\n<p>\nCopy the entire folder onto the pi, say into \/home\/pi\/raspidmx\/\n<\/p>\n<p>\nLook for the README.md&nbsp;note re building, currently:\n<\/p>\n<p style=\"margin-left: 40px;\">\nYou will need to install libpng before you build the program. On Raspbian<br \/>\nsudo apt-get install libpng12-dev\n<\/p>\n<pre>\r\n<code>\r\ncd \/home\/pi\/raspidmx\r\n<\/code><\/pre>\n<p>\nThen\n<\/p>\n<pre>\r\n<code>\r\nsudo make\r\n<\/code><\/pre>\n<p>\n&nbsp;\n<\/p>\n<h4>\nUsing<br \/>\n<\/h4>\n<p>\nUsage: pngview [-b <rgba>] [-d <number>] [-l <layer>] [-x <offset>] [-y <offset>] &lt;file.png&gt; <\/offset><\/offset><\/layer><\/number><\/rgba>\n<\/p>\n<p style=\"margin-left: 40px;\">\n-b &#8211; set background colour 16 bit RGBA<br \/>\n&nbsp; &nbsp; &nbsp;e.g. 0x000F is opaque black<br \/>\n-d &#8211; Raspberry Pi display number<br \/>\n-l &#8211; DispmanX layer number<br \/>\n-x &#8211; offset (pixels from the left)<br \/>\n-y &#8211; offset (pixels from the top)\n<\/p>\n<pre>\r\n<code>\r\n\t\/\/If pngview is in the same directory as us:\r\n\t.\/pngview -b 0 -l 3 \/home\/pi\/camerarecord\/image1.png &amp;\t\t#Transparent background (-b), Layer 3 (-l)\r\n\r\n\t\/\/If pngview is elsewhere:\r\n\t\/home\/pi\/raspidmx\/pngview\/pngview -b 0 -l 3 \/home\/pi\/camerarecord\/image1.png &amp;\t#Transparent background (-b), Layer 3 (-l)\r\n\t\r\n\t\/\/To clear images:\r\n\tsudo killall pngview\r\n<\/code><\/pre>\n<h4>\nIssues<br \/>\n<\/h4>\n<p>\nThere are limitations on how many images can be displayed. &nbsp;2 at once seems OK, above this may cause problems. &nbsp;See <a href=\"https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?f=35&amp;t=113240\">thread here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Loads a png image file and display it as a Dispmanx layer. Installing&nbsp;raspidmx raspidmx is a library created by&nbsp;AndrewFromMelbourne&nbsp;that leaverages&nbsp;some of the capabilities of the&nbsp;Dispmanx API. &nbsp;Its a great starting point for anyone wishing to learn the&nbsp;Dispmanx API which is very poorly documented. See the library homepage at&nbsp;https:\/\/github.com\/AndrewFromMelbourne\/raspidmx Copy the entire folder onto the pi, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[128,129],"tags":[],"class_list":["post-2609","post","type-post","status-publish","format-standard","hentry","category-dispmanx-api","category-images-software_utilities"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=2609"}],"version-history":[{"count":3,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2609\/revisions"}],"predecessor-version":[{"id":2617,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2609\/revisions\/2617"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=2609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=2609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=2609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}