{"id":2602,"date":"2016-07-13T11:23:55","date_gmt":"2016-07-13T11:23:55","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=2602"},"modified":"2016-07-13T12:41:51","modified_gmt":"2016-07-13T12:41:51","slug":"dispmanx-api-general","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/display\/dispmanx-api\/dispmanx-api-general","title":{"rendered":".DispmanX API General"},"content":{"rendered":"<p>\nThere is an API&nbsp;for the Raspberry Pi called DispmanX that allows you to add layers that are displayed over other layers. &nbsp;It seems the API isn&#39;t documented but as&nbsp;far as we&nbsp;know everything on the Raspberry Pi display is a DispmanX layer. &nbsp;So this means you can use it to do things like overlay images on top of say the camera live stream, another application, etc.\n<\/p>\n<h4>\nResources<br \/>\n<\/h4>\n<p>\n<a href=\"https:\/\/jan.newmarch.name\/RPi\/Dispmanx\/\">https:\/\/jan.newmarch.name\/RPi\/Dispmanx\/<\/a>\n<\/p>\n<h4>\nSetting which layer&nbsp;applications should use<br \/>\n<\/h4>\n<p>\nSome applications will allow you to specify the layer they should use.\n<\/p>\n<h5>\npngview<br \/>\n<\/h5>\n<p>\nBy default the pngview program adds a black background (on layer 0) to obscure the framebuffer. Use&nbsp;-b 0 to make&nbsp;this layer transparent instead. The new parameter -l specifies which DispmanX layer to display the image on. PNG file transparency is handled correctly\n<\/p>\n<p style=\"margin-left: 40px;\">\n.\/pngview -b 0 -l 3 \/usr\/share\/raspberrypi-artwork\/raspberry-pi-logo-small.png\n<\/p>\n<h5>\nomxplayer<br \/>\n<\/h5>\n<p>\nUse layer 2:\n<\/p>\n<p style=\"margin-left: 40px;\">\nomxplayer &#8211;layer 2 \/opt\/vc\/src\/hello_pi\/hello_video\/test.h264\n<\/p>\n<h4>\nExamples<br \/>\n<\/h4>\n<h5>\nPlace an image over raspvid<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n.\/pngview -b 0 -l 3 my_overlay_image.png &amp;\t\t#Transparent background (-b), Layer 3 (-l)\r\nraspivid -t 0\r\n\r\nkillall pngview #Use this to close the pngview afterwards\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is an API&nbsp;for the Raspberry Pi called DispmanX that allows you to add layers that are displayed over other layers. &nbsp;It seems the API isn&#39;t documented but as&nbsp;far as we&nbsp;know everything on the Raspberry Pi display is a DispmanX layer. &nbsp;So this means you can use it to do things like overlay images on [&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],"tags":[],"class_list":["post-2602","post","type-post","status-publish","format-standard","hentry","category-dispmanx-api"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2602","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=2602"}],"version-history":[{"count":6,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2602\/revisions"}],"predecessor-version":[{"id":2613,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2602\/revisions\/2613"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=2602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=2602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=2602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}