Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sub form's shadow effect using shape object
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01129983
Message ID:
01130045
Views:
33
This message has been marked as the solution to the initial question of the thread.
>Hi..
>
>I'm trying to create a shadow effect on the forms inside of my applications, using shape object.. Does anyone did this before? I'm trying to set the proper color and drawmode to give the optical ilusion closest possible for a shadow..
>
>If so.. Please would you mind to share what is the properties.. Or any other idea..
>
>TIA

Claudio,

Shadow color really depends on the background color of the shadow. Below is a simple prg that demonstrates that. When you run the prg, it will ask you to select the background color of the form. Once that's done, you can use the spinner to go up and down to determine show dark you want your shadow to be. When the shadow is dark enough, you'll see what I mean.
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


	**************************************************
*-- Form:         form1 
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   06/19/06 01:45:01 PM
*
DEFINE CLASS form1 AS form


	Top = 0
	Left = 0
	Height = 250
	Width = 490
	DoCreate = .T.
	Caption = "Form1"
	BackColor = RGB(0,253,253)
	Name = "Form1"


	ADD OBJECT shape1 AS shape WITH ;
		Top = 36, ;
		Left = 48, ;
		Height = 204, ;
		Width = 240, ;
		BorderStyle = 0, ;
		BackColor = RGB(0,223,223), ;
		Name = "Shape1"


	ADD OBJECT edit1 AS editbox WITH ;
		Height = 205, ;
		Left = 36, ;
		Top = 24, ;
		Width = 241, ;
		Name = "Edit1"


	ADD OBJECT spinner1 AS spinner WITH ;
		Height = 24, ;
		KeyboardHighValue = 100, ;
		KeyboardLowValue = 1, ;
		Left = 324, ;
		ReadOnly = .F., ;
		SpinnerHighValue = 100.00, ;
		SpinnerLowValue =   1.00, ;
		Top = 60, ;
		Width = 84, ;
		Value = 1, ;
		Name = "Spinner1"


	PROCEDURE Init
		thisform.BackColor = GETCOLOR(thisform.BackColor)
		thisform.spinner1.InteractiveChange()
	ENDPROC


	PROCEDURE spinner1.InteractiveChange
		LOCAL lnR as Integer, ;
			lnG as Integer, ;
			lnB as Integer 
		m.lnR = BITAND(thisform.BackColor,0x0000ff)
		m.lnG = BITRSHIFT(BITAND(thisform.BackColor,0x00ff00),8)
		m.lnB = BITRSHIFT(BITAND(thisform.BackColor,0xff0000),16)

		IF m.lnR > 0 ;
		THEN 
			m.lnR = INT(m.lnR * (1 - thisform.spinner1.Value/100))
		ENDIF 

		IF m.lnG > 0 ;
		THEN 
			m.lnG = INT(m.lnG * (1 - thisform.spinner1.Value/100))
		ENDIF 

		IF m.lnB > 0 ;
		THEN 
			m.lnB = INT(m.lnB * (1 - thisform.spinner1.Value/100))
		ENDIF 

		thisform.shape1.BackColor = RGB(m.lnR,m.lnG,m.lnB)
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform