Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    change drawtext size in GeUserArea [SOLVED]

    SDK Help
    0
    18
    1.2k
    Loading More Posts
    • 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
      Helper
      last edited by

      On 05/05/2015 at 22:20, xxxxxxxx wrote:

      Hi Mohamed,

      I'm currently at FMX. I'll be looking into this after my return next Monday.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 05/05/2015 at 23:49, xxxxxxxx wrote:

        I've also experienced this. DrawBitmap() seems to use the last pen
        color instead of mixing alpha pixels with the pixels that are already on
        the GeUserArea.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 06/05/2015 at 06:48, xxxxxxxx wrote:

          No need for the explicit additional bitmap and alpha channel allocation.
          You can set the transparency value with SetColor(r,g,b,a).

          i.e. cm->SetColor(r,g,b,128) will give a half transparent output.

          hth

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 06/05/2015 at 13:46, xxxxxxxx wrote:

            yea Samir, but it remains with an unavoidable bug!! , background is not transparent.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 07/05/2015 at 03:34, xxxxxxxx wrote:

              I can't confirm. It works. Here is the code:  
              
              OffScreenOn();
                  	Int32 w = 100;
                  	Int32 h = 100;
                   
                  	AutoAlloc<GeClipMap> bmp;
                  	bmp->Init(w,h,32);
                  	bmp->BeginDraw();
                   
                  	bmp->SetDrawMode(GE_CM_DRAWMODE_COPY,255);
                  	bmp->SetColor(255,255,255,0); //Fully transparent
                  	bmp->FillRect(0,0,w,h); //Set the whole bitmap transparent
                  	  
                          bmp->SetDrawMode(GE_CM_DRAWMODE_COPY,255);
                  	bmp->SetColor(255,255,255,128); //50% transparent
                  	bmp->TextAt(10,10,"Katachi rocks.. :-D"); //Draw text
                  	bmp->EndDraw();
                  	DrawBitmap(bmp->GetBitmap(),0,0,w,h,0,0,w,h,BMP_ALLOWALPHA);
              
              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 07/05/2015 at 06:43, xxxxxxxx wrote:

                Hi Samir,

                try to add DrawSetPen(Vector(0.8, 0.2, 0.2)); "or any other color" after OffScreenOn(); and you will find the bug, I tested your code and the same problem appears.

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 07/05/2015 at 10:23, xxxxxxxx wrote:

                  Then don't. Why are you using DrawSetPen?

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    On 07/05/2015 at 14:23, xxxxxxxx wrote:

                    drawing other stuff prior to texts, should I draw everything in one clipmap? not sure about performance, I will test, it may worth a shot!!

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

                      On 08/05/2015 at 01:19, xxxxxxxx wrote:

                      yes, if you don't have a good reason, you should stay with the clip map drawing functions.

                      1 Reply Last reply Reply Quote 0
                      • H
                        Helper
                        last edited by

                        On 16/05/2015 at 21:26, xxxxxxxx wrote:

                        after using GeClipMap in all drawings it worked perfectly , thanks all for the help, you can mark this as solved

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post