Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GDI+ Access
Message
De
07/06/2005 11:16:38
 
Information générale
Forum:
Visual FoxPro
Catégorie:
VFPX/Sedna
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01020618
Message ID:
01020952
Vues:
46
>Fabio,
>
>Please show me how you can access the off-screen bitmap that VFP is using when it paints a form. For clarification, I am not talking about putting GDI+ code in the Paint event of the form or even shutting the VFP off-screen bitmap off using Sys(602,0).

This is not fully optimized.
But this can to be a start point.
#DEFINE WM_KEYDOWN					0x0100
#DEFINE WM_KEYUP					0x0101
#DEFINE WM_PAINT					0x000F
#DEFINE WM_NCPAINT					0x0085
#DEFINE	GWL_WNDPROC					-4
				
PUBLIC oform1

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

DEFINE CLASS form1 AS form

	FillStyle = 7
	FillColor = RGB(255,0,0)	&& look a bug here !!!
	Name = "Form1"


	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 92, ;
		Top = 80, ;
		Width = 100, ;
		Name = "Text1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 44, ;
		Left = 152, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Command1", ;
		Name = "Command1"


	PROCEDURE winproc
	LPARAMETERS hWnd,msg,wParam,lParam
		DO CASE
			CASE m.msg = WM_NCPAINT
				this.BeforePaint
			CASE m.msg = WM_PAINT
				this.BeforePaint
		ENDCASE

		RETURN CallWindowProc(m.this.WndProc,m.hWnd,m.msg,m.wParam,m.lParam)
	ENDPROC


	PROCEDURE beforepaint
		* these write in the buffer
		Form::Cls
		Form::Circle(100,m.this.width/2,m.this.height/2,1)
	ENDPROC


	PROCEDURE Init

	DECLARE LONG	GetWindowLong	IN user32.dll	LONG	,INTEGER nIndex 
	DECLARE integer	CallWindowProc	IN user32.dll	;
              integer ,LONG , integer , integer ,integer

		PRIVATE this_hWnd
		STORE m.this.hWnd TO this_hWnd

		=ADDPROPERTY(m.THIS,'WndProc',GetWindowLong(m.this_hWnd,GWL_WNDPROC))

		=BINDEVENT(m.this_hWnd,WM_PAINT	 ,m.this,'WinProc')
		=BINDEVENT(m.this_hWnd,WM_NCPAINT	 ,m.this,'WinProc')
	ENDPROC

ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform