ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby joseluisysturiz » Fri Sep 01, 2017 6:02 pm

Greetings, I am presented to realize what you see in these video, a roulette wheel of fortune. Some idea of what tools to use or where to start for this job.? thanks in advance, regards ...

https://www.youtube.com/watch?time_cont ... LO0V5LlauM

https://www.youtube.com/watch?v=342ZRq8Q9ZE
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby nageswaragunupudi » Sat Sep 02, 2017 2:01 am

This sample demonstrates how to implement Spinning of an image.
Please test and modify to suit your requirements.
Code: Select all  Expand view  RUN
#include "fivewin.ch"

//----------------------------------------------------------------------------//

function Main()

   local cImage, oImage
   local oDlg

   cImage   := "c:\fwh\bitmaps\alphabmp\widgets.bmp"  // your image file

   DEFINE DIALOG oDlg SIZE 500,400 PIXEL TRUEPIXEL

   @ 20, 20 XIMAGE oImage SOURCE cImage SIZE 256,256 OF oDlg

   @ 20,300 BTNBMP PROMPT "Spin" SIZE 160,40 PIXEL OF oDlg FLAT ;
      ACTION Spin( oImage )

   ACTIVATE DIALOG oDlg CENTERED

return nil

//----------------------------------------------------------------------------//

function Spin( oImage )

   local nStep       := 5
   local n

   for n := 1 to 1000 / nStep
      oImage:Rotate( nStep )
      SysWait( 0.005 * nStep )
   next

return nil

//----------------------------------------------------------------------------//
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10663
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby joseluisysturiz » Sat Sep 02, 2017 4:54 am

Mr. NAGE, simplemente ESPECTACULAR, muchas gracias, es lo que necesitaba, no sabia seria tan facil, saludos, gracias... :shock:

Mr. NAGE, simply SPECTACULAR, thank you very much, it's what I needed, it would not be so easy, greetings, thanks... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby Otto » Sat Sep 02, 2017 5:37 am

Dear Mr. Rao,
thank you. This is really a nice sample.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6347
Joined: Fri Oct 07, 2005 7:07 pm

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby ukoenig » Sat Sep 02, 2017 11:40 am

I added a dialog-brush and tested the alpha-channel

Image

Code: Select all  Expand view  RUN

#include "fivewin.ch"

function Main()
local cImage, oImage
local oDlg

cImage   := "..\bitmaps\alphabmp\widgets.bmp"  // your image file

DEFINE DIALOG oDlg SIZE 500,400 PIXEL TRUEPIXEL TRANSPARENT  

@ 20, 20 XIMAGE oImage SOURCE cImage SIZE 256,256 OF oDlg NOBORDER

@ 20,300 BTNBMP PROMPT "Spin" SIZE 160,40 PIXEL OF oDlg FLAT ;
ACTION Spin( oImage )

ACTIVATE DIALOG oDlg CENTERED ;
ON INIT BuildBrush( oDlg )

return nil

// -------------

function BuildBrush( oDlg )
local oImage, oBrush, aRect := oDlg:GetRect()

DEFINE IMAGE oImage FILENAME "..\bitmaps\backgrnd\blustone.bmp"

oBrush   := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap,  aRect[4], aRect[3], .T. ) )  // 1 = stretch, 2 : fitoutside, 3:fitinside
oImage:End()
oDlg:SetBrush( oBrush )
oBrush:End()

return nil

//----------------

function Spin( oImage )
local nStep       := 5
local n

for n := 1 to 1000 / nStep
      oImage:Rotate( nStep )
      SysWait( 0.005 * nStep )
next

return nil
 


Added to the sample-collector

Image

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby joseluisysturiz » Sat Sep 02, 2017 5:34 pm

The spin of the roulette was great, now I have a very important detail, I will place an arrow that indicates or point the number that is selected, my question is, how the roulette is a complete image, how can I get the value selected.? I do not know how to get the selected value in the arrow ... I do not know if I was able to explain, thanks for the suggestions and ideas on how to get the selected result ... greetings, thanks ... :shock:

El giro de la ruleta quedo buenisimo, ahora se me presenta un detalle muy importante, voy a colocar una flecha que me indique o señale el numero que queda seleccionado, mi pregunta es, como la ruleta es una imagen completa, como puedo obtener el valor seleccionado.? se me ocurre dividir la imagen por angulos, pero no se como obtener el valor que quede seleccionado en la flecha... no se si me supe explicar, gracias por las sugerencias e ideas de como obtener el resultado seleccionado...saludos, gracias... :shock:

VIEW IMAGE / VER IMAGEN

[img]
http://subirimagen.me/uploads/20170902123213.jpg
[/img]
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby Enrico Maria Giordano » Sat Sep 02, 2017 8:21 pm

Maybe you can get the number from the current rotation angle?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby nageswaragunupudi » Sat Sep 02, 2017 8:29 pm

Do not put the arrow inside ximage rectangle. Place it as separate bitmap on the right side of ximage.
Visually user can read the number
Through program you should derive the number from oImage:nRotation
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10663
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby ukoenig » Sat Sep 02, 2017 10:08 pm

Converted and repainted to a real alphablended PNG
maybe You like it

http://www.pflegeplus.com/IMAGES/Roulette.png

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby joseluisysturiz » Sat Sep 02, 2017 11:35 pm

Enrico Maria Giordano wrote:Maybe you can get the number from the current rotation angle?

EMG


That is the point, in the class how to get the value of rotation, since instead of numbers, they will be some images, which each one will be in a certain angle, what I need to know is when the image is marked by the arrow, know what image it is, since this is a draw and automatically the system must say and display the name of the image indicated by the arrow ... the image you place is an example when you are finished spinning the roulette, saludos, gracias... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby joseluisysturiz » Sat Sep 02, 2017 11:39 pm

nageswaragunupudi wrote:Do not put the arrow inside ximage rectangle. Place it as separate bitmap on the right side of ximage.
Visually user can read the number
Through program you should derive the number from oImage:nRotation


Mr. Nage, the arrow as you say put it out of the image that rotates, in this case the roulette, I just put it as an example, what I need to know is what is the image or number that ends indicated by the arrow when the roulette stops, since the system automatically must say and show the image that I won or selected, the user will only rotate the roulette, I will review what he says of oImage: nRotation in class, greetings, thanks. .. :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby joseluisysturiz » Sat Sep 02, 2017 11:41 pm

ukoenig wrote:Converted and repainted to a real alphablended PNG
maybe You like it

http://www.pflegeplus.com/IMAGES/Roulette.png

regards
Uwe :D


Thank you Mr. UWE, I will try the image you converted, this image should be placed on or under a brush, and I will mount a complete image to understand what I want to do, greetings, thanks ...
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby joseluisysturiz » Mon Sep 11, 2017 10:10 pm

If the calculation of the degree of 360 / n is that of the division of the divisions, the que no se hacer es como determines the position of the figure or the degree resulting in an associado to dicha figure, at the same time it refiero y no se que propiedad de la clase me devuelve el grado resulting ya que la roulette puede llegar to give varias vueltas antes de detenerse como es logico que suceda ... alguna idea de como obtengo en la clase and the resultant result. saludos...gracias... :shock:

Se como calcular lo de los grados que es 360 / n que es la cantidad de diviciones, lo que no se hacer es como determinar la posicion de la figura o el grado resultando asociado a dicha figura, a eso me refiero y no se que propiedad de la clase me devuelve el grado resultante ya que la ruleta puede llegar a dar varias vueltas antes de detenerse como es lo logico que suceda...alguna idea de como obtengo en la clase el grado resultante.? saludos...gracias... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby nageswaragunupudi » Tue Sep 12, 2017 12:40 am

oImage:nRotate --> Degrees

nDegrees := oImage:nRotate % 360
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10663
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby joseluisysturiz » Tue Sep 12, 2017 3:21 am

nageswaragunupudi wrote:oImage:nRotate --> Degrees

nDegrees := oImage:nRotate % 360


Ready, now associate the numbers to the degrees ... greetings..thanks... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 55 guests