funkheld | allô, guten journée. comment peux je s'il te plaît qui Starpaint/EndPaint dans mon Programme dans un nProc de XPSE unterbringen ?
ici voudrais je vous s'il te plaît rein avons: nProc drawhPicRotated(long hPic,dc,x,y,xx,yy,w,r)
cet: startpaint vordergrpic& drawpic hintergrpic&,0,0;0 drawpic bpic1&,dx!,dy!;-1,$ff00ff endpaint
et si es aussi allez cet, welches de qui clavier gesteuert volonté:
startpaint bpic1& drawhPicRotated(bpicbmp&,hDC,50,50,50,50,winkel&,verh&) endpaint
cela heisst je voudrais seulement: drawhPicRotated(bpicbmp&,hDC,50,50,50,50,winkel&,verh&) aufrufenvon qui clavier et l'autre soll dans qui nProc abgearbeitet volonté.
Irgendwo J'ai eu ici la fois gelesen, cela so etws gemacht wurde.
merci. Gruss
{$cleq}
declare bpic&, bpic1&,bpicbmp&,ende&,winkel&,hintergrpic&,vordergrpic&
declare x1!,y1!,dx!,dy!,verh&
ende&=1
bpic& = create(«PCSI»,-1,"data\\voiture.bmp")
Fenêtre 20,20-800,600
Cls RGB(220,220,220)
bpicbmp& = create("hNewPic", 100,100,rgb(255,0,255))
bpic1& = create("hNewPic", 100,100,rgb(255,0,255))
hintergrpic& = create("hNewPic", 500,500,rgb(255,255,0))
vordergrpic& = create("hNewPic", 500,500,rgb(255,255,0))
startpaint bpicbmp&
drawpic bpic&,18,18;-1,$ff00ff
EndPaint
startpaint hintergrpic&
USEP 0,1,Rgb(,128,255)
usebrush 1,rgb(0,128,255)
ellipse 200,200-250,250
endpaint
verh&=75
dx!=60
dy!=60
startpaint bpic1&
drawhPicRotated(bpicbmp&,hDC,50,50,50,50,winkel&,verh&)
endpaint
WHILE ende&
si isKey(83)
y1!=Sin((winkel&/1000)/180.0*pi())*0.2
x1!=Cos((winkel&/1000)/180.0*pi())*0.2
dx!=dx!-x1!
dy!=dy!-y1!
endif
si isKey(87)
y1!=Sin((winkel&/1000)/180.0*pi())*0.2
x1!=Cos((winkel&/1000)/180.0*pi())*0.2
dx!=dx!+x1!
dy!=dy!+y1!
endif
si isKey(81)
winkel&=winkel&-1000
startpaint bpic1&
drawhPicRotated(bpicbmp&,hDC,50,50,50,50,winkel&,verh&)
endpaint
endif
si isKey(69)
winkel&=winkel&+1000
startpaint bpic1&
drawhPicRotated(bpicbmp&,hDC,50,50,50,50,winkel&,verh&)
endpaint
endif
startpaint vordergrpic&
drawpic hintergrpic&,0,0;0
drawpic bpic1&,dx!,dy!;-1,$ff00ff
endpaint
drawpic vordergrpic&,10,10;0
ENDWHILE
end
nProc getCircP(long r,w)
return long(sin(0.0174532925199433*float(w)/1000.0)*float(r))
endproc
nProc angleByLine(long x,y,xx,yy)
sub y,yy
sub x,xx
si x
xx=int(57295.77951 * arctan(float(y)/float(x)))
cas x>0 : return 270000 + xx
return 90000 + xx
endif
cas y<0 : return 180000
return 0
endproc
nProc drawhPicRotated(long hPic,dc,x,y,xx,yy,w,r)
long hDCBits=createCompatibleDC(hDC)
selectObject(hDCBits, hPic)
long pts=dim(24)
long w1=angleByLine(xx,yy,0,0)
Long w2=abs(w1-360000)
Long w3=abs(w1-540000)
casenot r : r=long(sqrt(float(xx*xx+yy*yy)))\2
long pts&,0=x+getcircp(r,w1+w)
long pts&,4=y+getcircp(r,w1-90000+w)
long pts&,8=x+getcircp(r,w2+w)
long pts&,12=y+getcircp(r,w2-90000+w)
long pts&,16=x+getcircp(r,w3+w)
long pts&,20=y+getcircp(r,w3-90000+w)
plgBlt(dc,pts,hDCBits,0,0,100,100,0,0,0)
deleteDC(hDCBits)
dispose(pts)
endproc
|
|