jaja good example!!! I used long time ago this technique with visual basic 6.0 but never tried it again.
Thanks again for the link and the tree. :-)
> >
> > Impressive!!! Thanks for the link.
>
> Indeed, and not very complicated.
> (Read more on Yousfi's blog:
http://yousfi.over-blog.com/2018/02/working-with-form-regions-and-transparency.html)
>
> I managed to create a small tree:
>
>
#define RGN_OR 2
> #define RGN_AND 1
> #define RGN_XOR 3
> #define RGN_DIFF 4
> #define RGN_COPY 5
> #define NULLREGION 1
> #define SIMPLEREGION 2
> #define COMPLEXREGION 3
> #define r_ERROR 0
> Declare Long CombineRgn IN WIN32API Long hrgnDest, Long hrgnSrc1, Long hrgnSrc2, Long fnCombineMode
> Declare Long SetWindowRgn IN WIN32API Long hWnd, Long hRgn, String bRedraw
> Declare Long CreateEllipticRgn IN WIN32API Long X1, Long Y1, Long X2, Long Y2
> Declare Long CreateRectRgn IN WIN32API Long X1, Long Y1, Long X2, Long Y2
> Declare Long DeleteObject IN WIN32API LONG hObject
>
> PUBLIC ofrm
> ofrm=CREATEOBJECT("MyForm")
> oFrm.visible=.T.
>
> DEFINE CLASS MyForm as Form
> backcolor = RGB(0,45,135)
> PROCEDURE lOAD
> This.reshape
> ENDPROC
> PROCEDURE resize
> This.reshape
> ENDPROC
> PROCEDURE reshape
> LOCAL lox0,x1,x2,x3
> lnPow0=1
> lox0 = CreateRectRgn(0, 0, This.width+2*SYSMETRIC(3), This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
> x1 = CreateRectRgn(SYSMETRIC(3), SYSMETRIC(4)+SYSMETRIC(9), 195 +SYSMETRIC(3), 110 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> ***********************
> DeleteObject(x1)
> x1=CreateEllipticRgn(50,10 + SYSMETRIC(4)+SYSMETRIC(9),100,60 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> DeleteObject(x1)
> x1=CreateEllipticRgn(110,10 + SYSMETRIC(4)+SYSMETRIC(9),160,60 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> ***********************
> DeleteObject(x1)
> x1=CreateEllipticRgn(15,60 + SYSMETRIC(4)+SYSMETRIC(9),65,110 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> DeleteObject(x1)
> x1=CreateEllipticRgn(80,60 + SYSMETRIC(4)+SYSMETRIC(9),130,110 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> DeleteObject(x1)
> x1=CreateEllipticRgn(145,60 + SYSMETRIC(4)+SYSMETRIC(9),195,110 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> ***********************
> DeleteObject(x1)
> x1=CreateEllipticRgn(15,110 + SYSMETRIC(4)+SYSMETRIC(9),65,160 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> DeleteObject(x1)
> x1=CreateEllipticRgn(80,110 + SYSMETRIC(4)+SYSMETRIC(9),130,160 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> DeleteObject(x1)
> x1=CreateEllipticRgn(145,110 + SYSMETRIC(4)+SYSMETRIC(9),195,160 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> ***********************
> DeleteObject(x1)
> x1=CreateEllipticRgn(50,160 + SYSMETRIC(4)+SYSMETRIC(9),100,210 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
>
> DeleteObject(x1)
> x1=CreateEllipticRgn(110,160 + SYSMETRIC(4)+SYSMETRIC(9),160,210 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_XOR )
> ***********************
> DeleteObject(x1)
> x1 = CreateRectRgn(100, 150 + SYSMETRIC(4)+SYSMETRIC(9), 110, 250 + SYSMETRIC(4)+SYSMETRIC(9))
> CombineRgn(lox0,lox0,x1,RGN_DIFF )
>
> SetWindowRgn(thisform.hwnd, lox0, "True")
> ENDPROC
> ENDDEFINE
>
> Respectfully
>
http://praisachion.blogspot.ro/