funkheld | Hello, good day. How can I Please The Starpaint/Endpaint in my Program in a nProc of XPSE unterbringen ?
here would like I tappt im dunkeln Please mere having: nProc drawhPicRotated(long hPic,dc,x,y,xx,yy,w,r)
these: startpaint vordergrpic& drawpic hintergrpic&,0,0;0 drawpic bpic1&,dx!,dy!;-1,$ff00ff endpaint
and if it too goes these, which from the keyboard gesteuert go:
startpaint bpic1& drawhPicRotated(bpicbmp&,hDC,50,50,50,50,winkel&,verh&) endpaint
the means i want only: drawhPicRotated(bpicbmp&,hDC,50,50,50,50,winkel&,verh&) aufrufenvon the keyboard and the others should in the nProc worn out go.
somewhere I had here time red, the so etws made watts.
Thank you. greeting
{$cleq}
declare bpic&, bpic1&,bpicbmp&,ende&,winkel&,hintergrpic&,vordergrpic&
declare x1!,y1!,dx!,dy!,verh&
ende&=1
bpic& = create("HPIC",-1,"data\\car.bmp")
Window 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)
ellipsis 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&
if 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
if 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
if isKey(81)
winkel&=winkel&-1000
startpaint bpic1&
drawhPicRotated(bpicbmp&,hDC,50,50,50,50,winkel&,verh&)
endpaint
endif
if 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
if x
xx=int(57295.77951 * arctan(float(y)/float(x)))
case x>0 : return 270000 + xx
return 90000 + xx
endif
case 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
|
|