Problem with TrimBrush

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

Problem with TrimBrush

Post by sinisrus »

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: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with TrimBrush

Post by airsoftsoftwair »

No, you'd have to examine every pixel in the alpha channel or mask to tell if a brush is "empty".
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: Problem with TrimBrush

Post by sinisrus »

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: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with TrimBrush

Post by airsoftsoftwair »

Ok, should be possible to add because the code is already in TrimBrush().
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: Problem with TrimBrush

Post by sinisrus »

Nice thank you :-)
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with TrimBrush

Post by airsoftsoftwair »

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