Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Hacking my way through

Hacking my way through

Scheduled Pinned Locked Moved The Lounge
graphicshelpdesignwpfwcf
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #1

    So I ran into a bit of a conundrum. Because of the way my user interface library works, it might draw half your control to a bitmap send that bitmap to the screen, and then repeat the process with the other half. A canvas is bound to a bitmap, and while I can change the bounds after the canvas is created, it will try to write to areas where the bitmap isn't present. When using callbacks, this is simply a performance issue. When using directing binding to the bitmap, this is an access violation. One option is to create a new canvas the size of the bitmap in UIX (my user interface lib) every time i refresh that control on the screen, but there are so many problems with this, starting with the size of that backing bitmap being an implementation detail, and that's not counting the performance issue of creating and destroying canvases all the time, when I should just be able to rebind it to a new bitmap. And the performance issue I mentioned in passing above is a real problem in UIX's case because maybe half the control will be drawn at once and the callbacks will be fired for ALL of it, half of it in vain as they get clipped from the final output. What I needed was a way to clip the drawing in my vector library, such that I could specify a clipping rectangle that perfectly overlays the backing bitmap. If I do that, the rasterizer never has to touch those "out of bounds" areas, saving time and potentially crashes. Well, I'm halfway there, but a bit overwhelmed and sort of procrastinating the rest of it. There's something I want to do after I complete this portion - and that is I want to support direct binds to an RGB565 bitmap. However, it gets a bit weird because there's no alpha channel in that color model. Currently I can only bind directly to an RGBA8888 bitmap, which isn't very practical on embedded in most situations. Situations where I can't bind directly use callbacks to do the final pixel reads/writes. I'm excited about that part. I want the challenge, but I'm stuck with the clipping problem first. Pizza incoming. That should fix it. :)

    Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

    Greg UtasG 1 Reply Last reply
    0
    • H honey the codewitch

      So I ran into a bit of a conundrum. Because of the way my user interface library works, it might draw half your control to a bitmap send that bitmap to the screen, and then repeat the process with the other half. A canvas is bound to a bitmap, and while I can change the bounds after the canvas is created, it will try to write to areas where the bitmap isn't present. When using callbacks, this is simply a performance issue. When using directing binding to the bitmap, this is an access violation. One option is to create a new canvas the size of the bitmap in UIX (my user interface lib) every time i refresh that control on the screen, but there are so many problems with this, starting with the size of that backing bitmap being an implementation detail, and that's not counting the performance issue of creating and destroying canvases all the time, when I should just be able to rebind it to a new bitmap. And the performance issue I mentioned in passing above is a real problem in UIX's case because maybe half the control will be drawn at once and the callbacks will be fired for ALL of it, half of it in vain as they get clipped from the final output. What I needed was a way to clip the drawing in my vector library, such that I could specify a clipping rectangle that perfectly overlays the backing bitmap. If I do that, the rasterizer never has to touch those "out of bounds" areas, saving time and potentially crashes. Well, I'm halfway there, but a bit overwhelmed and sort of procrastinating the rest of it. There's something I want to do after I complete this portion - and that is I want to support direct binds to an RGB565 bitmap. However, it gets a bit weird because there's no alpha channel in that color model. Currently I can only bind directly to an RGBA8888 bitmap, which isn't very practical on embedded in most situations. Situations where I can't bind directly use callbacks to do the final pixel reads/writes. I'm excited about that part. I want the challenge, but I'm stuck with the clipping problem first. Pizza incoming. That should fix it. :)

      Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

      Greg UtasG Offline
      Greg UtasG Offline
      Greg Utas
      wrote on last edited by
      #2

      Pizza can fix a lot of things. So can a rubber duck. It seems like you should invest in one. :-D

      Robust Services Core | Software Techniques for Lemmings | Articles
      The fox knows many things, but the hedgehog knows one big thing.

      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

      R H 2 Replies Last reply
      0
      • Greg UtasG Greg Utas

        Pizza can fix a lot of things. So can a rubber duck. It seems like you should invest in one. :-D

        Robust Services Core | Software Techniques for Lemmings | Articles
        The fox knows many things, but the hedgehog knows one big thing.

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        Greg Utas wrote:

        So can a rubber duck.

        Aye! :thumbsup: /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        1 Reply Last reply
        0
        • Greg UtasG Greg Utas

          Pizza can fix a lot of things. So can a rubber duck. It seems like you should invest in one. :-D

          Robust Services Core | Software Techniques for Lemmings | Articles
          The fox knows many things, but the hedgehog knows one big thing.

          H Offline
          H Offline
          honey the codewitch
          wrote on last edited by
          #4

          Greg Utas wrote:

          So can a rubber duck. It seems like you should invest in one

          Tired of hearing from me, eh? :laugh:

          Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

          J Greg UtasG 2 Replies Last reply
          0
          • H honey the codewitch

            Greg Utas wrote:

            So can a rubber duck. It seems like you should invest in one

            Tired of hearing from me, eh? :laugh:

            Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

            J Offline
            J Offline
            Joe Fallon
            wrote on last edited by
            #5

            Ohhh! We're the rubber duck!

            F 1 Reply Last reply
            0
            • J Joe Fallon

              Ohhh! We're the rubber duck!

              F Offline
              F Offline
              Forogar
              wrote on last edited by
              #6

              Aha! You got it!

              - I would love to change the world, but they won’t give me the source code.

              1 Reply Last reply
              0
              • H honey the codewitch

                Greg Utas wrote:

                So can a rubber duck. It seems like you should invest in one

                Tired of hearing from me, eh? :laugh:

                Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                Greg UtasG Offline
                Greg UtasG Offline
                Greg Utas
                wrote on last edited by
                #7

                Nah. Your streams of consciousness are usually interesting. :-D But a duck interacts with you, so you wouldn't have to anticipate all the details that you must first explain!

                Robust Services Core | Software Techniques for Lemmings | Articles
                The fox knows many things, but the hedgehog knows one big thing.

                <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups