Page 1 of 1

Erase with alphaChannel

Posted: Mon Dec 05, 2016 5:27 pm
by sinisrus
Hello,

I can not erase with a fade of brush 1

Thank for your help

Code: Select all

/* Nouveau projet Hollywood */

SetFillStyle(#FILLCOLOR)
CreateBrush(1, 100, 100, #BLACK, {AlphaChannel = True, Clear=True})
SelectBrush(1,#SELMODE_COMBO,2)
Circle(#CENTER,#CENTER,30,#WHITE)
EndSelect

BlurBrush(1,30)

W=GetAttribute(#BRUSH,1,#ATTRWIDTH)
H=GetAttribute(#BRUSH,1,#ATTRHEIGHT)

/*****************************************/  

Function p_Move(msg)

  ShowLayer(2,MouseX()-(W*0.51),MouseY()-(H*0.51))

  IF IsLeftMouse()
    SelectAlphaChannel(Temp)
    SetAlphaIntensity(0)
    DisplayBrush(1,mouseX()-(W*0.51),mouseY()-(H*0.51))
    EndSelect

        SelectLayer(1,#SELMODE_COMBO)
        DisplayBrush(TEMP,0,0)
        EndSelect
  EndIf

  IF (msg.action="OnRightMouseDown")
    SelectAlphaChannel(TEMP)
    SetAlphaIntensity(255)
    Cls
    EndSelect

    SelectLayer(1,#SELMODE_COMBO)
    DisplayBrush(TEMP,0,0)
    EndSelect
  EndIF

EndFunction

/*****************************************/ 

SetInterval(1, p_Move, 1000/50) ; 50fps
InstallEventHandler({OnMouseDown = p_Move, OnRightMouseDown = p_Move})

EnableLayers()

TEMP=CreateBrush(Nil, 640, 480, #BLUE, {AlphaChannel = True, Clear=0})
InsertLayer(1,#BRUSH,TEMP,0,0)

InsertLayer(2,#BRUSH,1,MouseX()-(W*0.51),MouseY()-(H*0.51))


EscapeQuit(True)

/* Boucle infinie */
Repeat
        WaitEvent
Forever

Re: Erase with alphaChannel

Posted: Wed Dec 07, 2016 10:01 pm
by airsoftsoftwair
I'm not a thought reader... what do you want to do? :)

Re: Erase with alphaChannel

Posted: Wed Dec 07, 2016 11:05 pm
by sinisrus
I am sorry my english is vert bad

If i paint with brush smooth border work OK
If i erase with brush smooth border not correct work (border not smooth for erase is not correct my brush have smooth border)

Use my exemple for see

Is ok for you?

Re: Erase with alphaChannel

Posted: Thu Dec 08, 2016 2:32 pm
by sinisrus
Look link picture make with photoshop
- UP paint with smooth brush
- Down erase with smooth brush

Hollywood erase with smooth brush just flat
I tested with SetAlphaIntensity(#VANILLACOPY) => (not good work) :-/

http://www.hostingpics.net/viewer.php?i ... terase.jpg

Re: Erase with alphaChannel

Posted: Sun Dec 11, 2016 12:11 pm
by airsoftsoftwair
This is certainly possible with Hollywood but from the top of my head I can't tell what would be the best way to do it. I think you should experiment with SelectBrush() using #SELMODE_COMBO and combomode 2.

Re: Erase with alphaChannel

Posted: Sun Dec 11, 2016 4:45 pm
by sinisrus
No SelectBrush (MyBrush, # SELMODE_COMBO, 2) is for drawing with a brush that has smooth

I want to make a hole with smooth border (erase) in a brush

Normally with

SelectAlphaChannel (Temp)
SetAlphaIntensity (#VANILLACOPY)
DisplayBrush (1, MouseX (), MouseY ())
EndSelect
  
But it does not work properly

Re: Erase with alphaChannel

Posted: Wed Apr 19, 2017 11:55 am
by sinisrus
My brush has several levels of transparencies, I would like to erase with its levels of transparencies (currently hollywood erases with just 1 level only And not several at the same time)