{"id":4151,"date":"2022-01-24T14:25:53","date_gmt":"2022-01-24T14:25:53","guid":{"rendered":"http:\/\/truelogic.org\/wordpress\/?p=4151"},"modified":"2022-02-17T09:00:18","modified_gmt":"2022-02-17T09:00:18","slug":"11-wxwidgets-graphics","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2022\/01\/24\/11-wxwidgets-graphics\/","title":{"rendered":"11.wxWidgets &#8211; Graphics"},"content":{"rendered":"\n<p><strong>OVERVIEW<\/strong><\/p>\n\n\n\n<p>We now look at how to do 2d graphics in wxWidgets. Displaying graphics is different from displaying text &#8211; you need something called a Device Context. A Device Context is a software layer which enables your code to interact with the display hardware. It acts as a virtual display on which you draw graphics. The virtual display then translates this onto the actual display hardware. In short a Device Context allows you to do 2d graphics without having to worry about the underlying hardware. <\/p>\n\n\n\n<p>wxWidgets provides functions and classes for interacting with any Device Context. These classes and functions fall under GDI (Graphics Device Interface). GDI consist of three things <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>2d vector graphics<\/li><li>Fonts<\/li><li>Images<\/li><\/ul>\n\n\n\n<p>wxWidgets has a base Device Context called wxDC. But this class is never used directly as it already has predefined subclass like:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>wxBufferedDC<\/li><li>wxMemoryDC<\/li><li>wxScreenDC etc.<\/li><\/ul>\n\n\n\n<p>In the sections ahead we will work with basic GDI functions<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/truelogic.org\/wordpress\/2022\/01\/24\/wxwidgets-11a-drawing-lines\/\">11a.Drawing Lines<\/a><\/li><li><a href=\"https:\/\/truelogic.org\/wordpress\/2022\/01\/24\/11b-wxwidgets-drawing-text\/\">11b.Drawing Text<\/a><\/li><li><a href=\"https:\/\/truelogic.org\/wordpress\/2022\/01\/24\/11c-wxwidgets-drawing-points\/\">11c.Drawing Points<\/a><\/li><li><a href=\"https:\/\/truelogic.org\/wordpress\/2022\/01\/24\/11d-wxwidgets-the-pen-object\/\">11d.The Pen Object<\/a><\/li><li><a href=\"https:\/\/truelogic.org\/wordpress\/2022\/01\/24\/11e-wxwidgets-regions\/\">11e. Regions<\/a><\/li><li><a href=\"https:\/\/truelogic.org\/wordpress\/2022\/01\/24\/11f-wxwidgets-gradient\/\">11f.Gradient<\/a><\/li><li><a href=\"https:\/\/truelogic.org\/wordpress\/2022\/01\/24\/11g-wxwidgets-shapes\/\">11g.Shapes<\/a><\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>OVERVIEW We now look at how to do 2d graphics in wxWidgets. Displaying graphics is different from displaying text &#8211; you need something called a <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2022\/01\/24\/11-wxwidgets-graphics\/\" title=\"11.wxWidgets &#8211; Graphics\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":3595,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302,365],"tags":[],"class_list":["post-4151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cc","category-wxwidgets"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/4151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=4151"}],"version-history":[{"count":5,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/4151\/revisions"}],"predecessor-version":[{"id":4294,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/4151\/revisions\/4294"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media\/3595"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=4151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=4151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=4151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}