Easier MUI Drawing

Posted by ALB42 on 27. Januar 20185 Comments

Working on the DrawPanel, thats an MUI Area object which exports the usual Events you know from LCL objects, like OnPaint (here OnDrawObject), OnMouse____, OnKey____, such stuff. With this it is very easy to create a simple painting application:

(Notice my awesome drawing skills 😉 )
With it, I developed a TDrawBuffer, which saves you the work of Allocating a Bitmap, create a layer and RastPort. I noticed I have this kind of code in many of my MUI applications, therefore it make sense to make a little handy class out of it. I could have some more functions. I tested the whole stuff on Amiga, AROS and MorphOS and it works fine on all of them, very nice.

5 comments to "Easier MUI Drawing"

  1. Andi Friede sagt:

    Great!!!
    Thats what makes Life much easier.

    Is this already working on OS4?
    Last try gave me “unit commodities” Not fond Error.

    • ALB42 sagt:

      I did not try (I do not own a OS4 System), but if it follows standard MUI stuff it should work (it works on OS3, MorphOS, AROS).
      Yeah, I forget that at FPC OS4 the Commodities library unit is still not present. If I remember right, it’s only needed for the PBroker type you could create an almost empty commodities unit with “PBroker = Pointer” type definition inside. I will look into it later, and try to take that part out for OS4 (some ifdefs), or maybe someone wants to implement the OS4 comodities library unit 😉 .

      • Andi Friede sagt:

        Hi Alb42 !
        Wow thanx a lot for your quick answer and the hint for commodities 🙂
        I will try that.
        And I am looking forward to try all your fantastic Work on Vampire once I got one 😉

        • ALB42 sagt:

          I updated it for OS4 should compile now without any problem. The DrawPanel example seems to work, the Testapp crashes, some problems with the List class as it seems from the stacktrace, but without a real machine I can’t debug that. Just check the latest github version if it work for you as well.

          It would be nice to hear some feedback, or if you found something which could do better, or I missed something. Currently I write the documentation for it and noticed that I missed some fields. For feedback you can use the forum FPC4Amiga Forum. Have fun

  2. Andi Friede sagt:

    Wwooohhhoooooo ….
    Thanx a lot for your Time and Work!
    Thats awsome from you.

    I will try IT out and give feedback for Sure 🙂

    Special greetings
    Andi

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.