Victorio wrote:Have some solution to run this example?
do you mean Express++ Sample ... exclude EVAL( Codeblock ) from that line
Victorio wrote:I need some examples where is used redraw function for my map viewer based on vector graphics.
In example is some like I want.
I am comment line with error then program run and show main window with menu, but it is all what I can do.
i guess you want to load a Picture and have Repaint Problem ?
here you fill o:Paint Codeblock (of XbpStatic() / XbpWindow() ) with your Function "to paint" ( oBMP:draw() ) , which will override Windows OS() default, when WM_PAINT is fired.
if you want to "paint" into your Image you have to use the Presspace of Image !!!
I want examine lockPS, unlockPS, but I do not understand, what this function/procedure do ?
I want speedy drawing because drawing about 200000-400000 lines is too slow.
Has using lockPS, unlockPS some effect to speed drawing ?
I examine using array to read coordinates of lines from database and then drawing, but no effect.
Here is little example, I do not know, why kresliciary() drawing lines, but kresliciary3() NO !.
Can I use lockPS, unlockPS for drawing vector elements ( like GraLine..-...) ?
In my example, I have main window (application window), with menu, and in it some other graphic window oPS.
I want draw to this window, but controlling with menu and some buttons, like in PENDRAW example.
PUBLIC oDlg, oDialog, oPS,oMF,oDevice,oMenu
PUBLIC aPos[2], aSize[2],aPosu[2],aSizeu[2],farba:=1,zoomfaktor:=0
* toto iba pomocnß premennß, ak zmenÝm farbu, mierku,... pokyn na prekreslenie
PUBLIC zmena:=.F.
* zistenie rozmerov aktußlnej obrazovky podża rozlÝÜenia v pixeloch, tj. max.rozmery
aSize := SetAppWindow():currentSize()
* toto je pozÝcia, kde sa umiestni okno, teda lavy dolny roh
* teda vypoŔÝtanÚ ako 0.01 z aSize ktorÚ je zase zistenÚ cez currentSize
aPos[1] := 0.05 * aSize[1]
aPos[2] := 0.05 * aSize[2]
* toto je rozmer hlavnÚho okna aplikßcie, ktorÚ sa otvorÝ pri spustenÝ programu
aSize[1] := aSize[1]*0.95
aSize[2] := aSize[2]*0.95
LOCAL i,j,k
LOCAL nEvent := NIL, mp1 := NIL, mp2 := NIL, oXbp := NIL, drawingArea
LOCAL nSegId:=0
PUBLIC pocetbodov
PUBLIC a_x_sur[1000000],a_y_sur[1000000],a_t_spoj[1000000]
aSizeu[1]=aSize[1]*0.8
aSizeu[2]=aSize[2]*0.8
* HERE DRAWING 4 lines, OK, GOOD !
****************************************************
* tu kreslÝ automaticky Ŕiary na obrazovku, ok, aj pri posune sa uchovß kresba
*oDialog:drawingArea:paint:={||kresliciary(oPS,@nSegId)}
* HERE DRAWING 4 lines, but ??? NOTHING ON SCREEN ??? WHY ?
*************************************************************************************
oDialog:drawingArea:paint:={||kresliciary3(oPS,@nSegId)}
* toto sk˙siŁ vyhodiŁ ???
oDialog:show()
SetAppFocus(oDialog)
* cyklus pre Ŕakanie na Quit, nßhrada Inkey(0) ktorř tu nefunguje
DO WHILE nEvent <> xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
FUNCTION kresliciary(oPS,nSegId)
GraSetColor( oPS, GRA_CLR_RED )
...
return
FUNCTION kresliciary3(oDialog,nSegId)
// if you don´t have pass oPS you have to create it
LOCAL oPS:=oDialog:drawingArea:lockPS()
GraSetColor( oPS, GRA_CLR_RED )
...
oDialog:drawingArea:unlockPS(oPS)
return
! Note : all Xbparts Callback Slots have self = oSelf as Parameter between | here Parameter | ...