Problem with TrimBrush

Find quick help here to get you started with Hollywood
Post Reply
sinisrus
Posts: 251
Joined: Tue Apr 21, 2015 5:43 pm

Problem with TrimBrush

Post by sinisrus » Thu Sep 06, 2018 11:05 pm

Hello,

If i use Trimbrush() with empty brush hollywood return error
Is there a function to know if the brush is empty ?

Code: Select all

CreateBrush(1,50,50,#BLACK, {AlphaChannel = True, Clear = True})
Local X,Y =TrimBrush(1)

Debugprint(X,Y)

User avatar
airsoftsoftwair
Posts: 2670
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with TrimBrush

Post by airsoftsoftwair » Fri Sep 07, 2018 10:54 pm

No, you'd have to examine every pixel in the alpha channel or mask to tell if a brush is "empty".

sinisrus
Posts: 251
Joined: Tue Apr 21, 2015 5:43 pm

Re: Problem with TrimBrush

Post by sinisrus » Fri Sep 07, 2018 11:45 pm

This solution is too slow :|
Can you create an IsBrushEmpty () or TrimBrush () function returns -1, -1 if the brush is empty?

Please, it's very important for my project

Thank you for your reply

User avatar
airsoftsoftwair
Posts: 2670
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with TrimBrush

Post by airsoftsoftwair » Sat Sep 08, 2018 10:19 pm

Ok, should be possible to add because the code is already in TrimBrush().

sinisrus
Posts: 251
Joined: Tue Apr 21, 2015 5:43 pm

Re: Problem with TrimBrush

Post by sinisrus » Sat Sep 08, 2018 11:42 pm

Nice thank you :-)

User avatar
airsoftsoftwair
Posts: 2670
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with TrimBrush

Post by airsoftsoftwair » Sat Dec 01, 2018 3:59 pm

Code: Select all

- New: Added IsBrushEmpty() function; this returns TRUE in case a brush has an alpha channel or a
  mask and all pixels are invisible

Post Reply