Rotate brush is not identique to source

Report any Hollywood bugs here
Post Reply
sinisrus
Posts: 217
Joined: Tue Apr 21, 2015 5:43 pm

Rotate brush is not identique to source

Post by sinisrus » Fri Sep 23, 2016 4:57 pm

Hello,

I have problem with rotate brush :

Code: Select all

/* Nouveau projet Hollywood */

 

@DISPLAY 1,{COLOR=#GRAY}

XScreenWidth=300

A=CreateBrush(NIL,XScreenWidth,27,#BLACK,{AlphaChannel = True, Clear=True})

SetFont(#SANS,15)
SetFontStyle(#ANTIALIAS)

SelectBrush(A,#SELMODE_COMBO,2)
  SetFillStyle(#FILLCOLOR)
  BOX(1,0,XScreenWidth,27,$6EBEFF)

  FOR i=0 TO XScreenWidth
      IF (i%2=0)
      LINE(PosX+i,PosY,PosX+i,PosY+3,COLOR1)
      LINE(PosX+i,#BOTTOM,PosX+i,#BOTTOM-3,COLOR1)
      ENDIF
  NEXT
EndSelect

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

B=CopyBrush(A,Nil)
C=CopyBrush(B,Nil)

SelectBrush(A) Textout(#CENTER,#CENTER-1,"Original A") EndSelect

SelectBrush(B) Textout(#CENTER,#CENTER-1,"Copy A To B and rotate (not identique to A)") EndSelect
RotateBrush(B,-90)

SelectBrush(C) Textout(#CENTER,#CENTER-1,"Copy B To C and rotate (not identique to A)") EndSelect
RotateBrush(C,-360)

DisplayBrush(A,30,5)         
DisplayBrush(B,30,35)
DisplayBrush(C,30,350)

 

/* Boucle infinie */
Repeat
        WaitEvent
Forever

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

Re: Rotate brush is not identique to source

Post by airsoftsoftwair » Thu Sep 29, 2016 5:38 pm

That is a feature ;) RotateBrush() will always run its transformation code. It won't treat modulo 90, 180, 270 and 360 rotations as special cases and run special code. But you can easily implement this yourself and just call FlipBrush() or CopyBrush() in case of a special rotation angle...

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

Re: Rotate brush is not identique to source

Post by sinisrus » Thu Sep 29, 2016 8:53 pm

Rotate with copybrush()??? Is it possible???

Thann you

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

Re: Rotate brush is not identique to source

Post by airsoftsoftwair » Thu Sep 29, 2016 10:57 pm

No, what I meant was that if you pass 360 to RotateBrush(), you probably just want to do nothing because nothing will change with an angle of 360, so you shouldn't call RotateBrush() in that case.

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

Re: Rotate brush is not identique to source

Post by sinisrus » Fri Sep 30, 2016 7:47 am

it is not possible to rotate 90, 180 identical with hollywood?

xabierpayet
Posts: 160
Joined: Fri Feb 24, 2012 10:34 am

Re: Rotate brush is not identique to source

Post by xabierpayet » Sun Oct 02, 2016 11:58 pm

try this,will work fine

SelectBrush(B) Textout(#CENTER,#CENTER-1,"Copy A To B and rotate (not identique to A)") EndSelect
RotateBrush(B,-90,1,1,true)

SelectBrush(C) Textout(#CENTER,#CENTER-1,"Copy B To C and rotate (not identique to A)") EndSelect
RotateBrush(C,-360,1,1,true)

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

Re: Rotate brush is not identique to source

Post by sinisrus » Mon Oct 03, 2016 4:39 pm

I am sorry is not identique. look carefully :-/

thanks anyway

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

Re: Rotate brush is not identique to source

Post by airsoftsoftwair » Fri Oct 07, 2016 10:23 pm

Well, I could add some code of course that treats 90, 180, 270, 360 degrees rotations as special cases and uses dedicated code for them to give the best results. I'll see what I can do.

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

Re: Rotate brush is not identique to source

Post by sinisrus » Sun Nov 27, 2016 10:58 am

Thank you for this :-)

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

Re: Rotate brush is not identique to source

Post by airsoftsoftwair » Tue Jan 17, 2017 8:47 pm

Code: Select all

- New: RotateBrush(), TransformBrush() as well as all other functions that rotate images now use
  dedicated code to handle the special cases of a rotation by 90, 180, 270, and 360 degrees to
  transform the image data; this is much faster and the transformation is also done in a lossless
  way

Post Reply