ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
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
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!
Gracias a mi Dios ante todo!
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
This sample demonstrates how to implement Spinning of an image.
Please test and modify to suit your requirements.
Please test and modify to suit your requirements.
Code: Select all | Expand
#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
G. N. Rao.
Hyderabad, India
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
Mr. NAGE, simplemente ESPECTACULAR, muchas gracias, es lo que necesitaba, no sabia seria tan facil, saludos, gracias...
Mr. NAGE, simply SPECTACULAR, thank you very much, it's what I needed, it would not be so easy, greetings, thanks...

Mr. NAGE, simply SPECTACULAR, thank you very much, it's what I needed, it would not be so easy, greetings, thanks...

Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 24 times
- Been thanked: 2 times
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
Dear Mr. Rao,
thank you. This is really a nice sample.
Best regards,
Otto
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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
I added a dialog-brush and tested the alpha-channel

Added to the sample-collector

regards
Uwe

Code: Select all | Expand
#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

regards
Uwe

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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
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 ...
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...
VIEW IMAGE / VER IMAGEN
[img]
http://subirimagen.me/uploads/20170902123213.jpg
[/img]

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...

VIEW IMAGE / VER IMAGEN
[img]
http://subirimagen.me/uploads/20170902123213.jpg
[/img]
Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
Maybe you can get the number from the current rotation angle?
EMG
EMG
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
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
Visually user can read the number
Through program you should derive the number from oImage:nRotation
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
Converted and repainted to a real alphablended PNG
maybe You like it
http://www.pflegeplus.com/IMAGES/Roulette.png
regards
Uwe
maybe You like it
http://www.pflegeplus.com/IMAGES/Roulette.png
regards
Uwe

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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
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...

Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
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. ..

Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
ukoenig wrote:Converted and repainted to a real alphablended PNG
maybe You like it
http://www.pflegeplus.com/IMAGES/Roulette.png
regards
Uwe
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!
Gracias a mi Dios ante todo!
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
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...
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...

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...

Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
oImage:nRotate --> Degrees
nDegrees := oImage:nRotate % 360
nDegrees := oImage:nRotate % 360
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- joseluisysturiz
- Posts: 2064
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE
nageswaragunupudi wrote:oImage:nRotate --> Degrees
nDegrees := oImage:nRotate % 360
Ready, now associate the numbers to the degrees ... greetings..thanks...

Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!