Jup danke.
Dein Hinweis ist ja wunderbar.
Danke.
Gruss
Jup danke.
Dein Hinweis ist ja wunderbar.
Danke.
Gruss
Jup, danke.
Ich wollte die nehmen "Winkel = ArcTan((y2-y1)/(x2-x1))"
Nur kannst du mir bitte mal zeigen mit einer if-Abfrage wie es mit den 4 Quadranten funktioniert.
Das von y2-y1 und x2-x1 keine Null weitergegeben wird fange ich ab.
Ich brauche die Gradzahlen nur für eine Grafikdrehung (Vector-Bild).
Danke.
Gruss
Jup, danke.
Der eine Punkt war nicht 3300 sondern 330...Sorry
Warum diese vielen if abfragen ? Müssen das so viele sein ?
Könntest du das bitte mal so kurz wie möglich machen und das bitte 360 Grad bzw 2xPi abgedeckt werden von den 2 Punkten? Das mit den Quadranten versteh ich auch nicht, habe nur gehört, das es irgendwie damit reingehört.
Ich möchte es dann umschreiben für XPIA-ASM.
Danke.
Gruss
Hallo, guten Tag.
Ich möchte bitte mal den Winkel berechnen von 2 Punkten:
x=310 : y=3300 , von da aus möchte ich den Winkel zu Punkt x=200 : y=350 berechnen?
Wer kann mir mal helfen ?
Danke.
Gruss
Hallo, wie werden bitte Float-Werte an die Dll übergeben.
Gefordert wird ja eine Long .
Habe das mit deiner Dll2Inc.exe erstellt.
Danke.
GRuss
$MAKE CLE
Declare a&,b&,c&,d&
Def _FpuAdd(4) !"biglib","_FpuAdd"
Def _FpuAtoFL(3) !"biglib","_FpuAtoFL"
Def _FpuDiv(4) !"biglib","_FpuDiv"
Def _FpuFLtoA(4) !"biglib","_FpuFLtoA"
Def _FpuMul(4) !"biglib","_FpuMul"
Def _FpuSqrt(3) !"biglib","_FpuSqrt"
Def _FpuSub(4) !"biglib","_FpuSub"
a&=?
b&=?
c&=?
d&=&
Print _FpuAdd(a&,b&,c&,d&)
WaitKey
End
Alles anzeigen
Jup danke für die Info.
Gruss
Hallo, guten Tag.
Dieses Case wird angemeckert von FreePofan : Endwhile wird nicht gefunden. Dabei gibbet es bei Case kein Endwhile.
GRuss
Case filesize(load$) = -1 : Break
PROC WaveHeader
Declare b#,hz$,chan$,bits$, riff$, wave$,bytessec$,bytessample$,chunk$
Parameters load$
SetErrorLevel -1
Case filesize(load$) = -1 : Break
SetErrorLevel 0
Dim B#,filesize(load$)
Assign #1,load$
OpenRW #1
'RIFF
BlockRead(#1,b#,0,4)
riff$ = Char$(b#,0,4)
'CHUNK LÄNGE (Header Länge?)
BlockRead(#1,b#,0,4)
'WAVE
BlockRead(#1,b#,0,4)
wave$ = Char$(b#,0,4)
'FMT
BlockRead(#1,b#,0,4)
'Chunk Länge (???)
BlockRead(#1,b#,0,4)
'Format (0 = Mono, 1 = Stereo)
BlockRead(#1,b#,0,2)
'Kanäle (Mono/Stereo)
BlockRead(#1,b#,0,2)
chan$ = Str$(Byte(b#,0))
'Frequenz in Hertz
BlockRead(#1,b#,0,4)
hz$ = "%" + MkStr$("0",(8 - Len(Bin$(Byte(b#,2))))) + Bin$(Byte(b#,2)) + MkStr$("0",(8 - Len(Bin$(Byte(b#,1))))) + Bin$(Byte(b#,1)) + MkStr$("0",(8 - Len(Bin$(Byte(b#,0))))) + Bin$(Byte(b#,0))
hz$ = Str$(Int(Val(hz$)))
'Bytes pro Sekunde
BlockRead(#1,b#,0,4)
bytessec$ = "%" + MkStr$("0",(8 - Len(Bin$(Byte(b#,2))))) + Bin$(Byte(b#,2)) + MkStr$("0",(8 - Len(Bin$(Byte(b#,1))))) + Bin$(Byte(b#,1)) + MkStr$("0",(8 - Len(Bin$(Byte(b#,0))))) + Bin$(Byte(b#,0))
bytessec$ = Str$(Int(Val(bytessec$)))
'Byte pro Sample
BlockRead(#1,b#,0,2)
bytessample$ = Str$(Byte(b#,0))
'Bits pro Sample
BlockRead(#1,b#,0,2)
bits$ = Str$(Byte(b#,0))
'Chunk Name
BlockRead(#1,b#,0,4)
'Chunk Länge
BlockRead(#1,b#,0,4)
chunk$ = "%" + MkStr$("0",(8 - Len(Bin$(Byte(b#,2))))) + Bin$(Byte(b#,2)) + MkStr$("0",(8 - Len(Bin$(Byte(b#,1))))) + Bin$(Byte(b#,1)) + MkStr$("0",(8 - Len(Bin$(Byte(b#,0))))) + Bin$(Byte(b#,0))
chunk$= Str$(int(val(chunk$)))
Dispose b#
print "Typ: " + riff$ + " / " + wave$
print "Länge des Datenbereichs: " + chunk$ + " Bytes"
print "Bytes pro Sekunde: " + bytessec$
print "Bytes pro Sample: " + bytessample$
print "Kanäle: " + chan$
print "Hetz: " + hz$
print "Bits: " + bits$
Close rw #1
ENDPROC
WaveHeader LoadFile$("Wave Datei öffnen","Wave Datei (*.WAV)|*.WAV")
WaitInput
End
Alles anzeigen
Hallo, guten Tag.
Ich möchte bitte das Startpaint/Endpaint mit in die ASM einbinden für die bpic& .
Wie geht das ?
Danke.
$MAKE CLE
Declare bpic&
Declare radius!,wid!
If 0
AsmStart _movetoex(hdcwin&,x&,y&)
invoke MoveToEx,para1,para2,para3,0
AsmEnd
AsmStart _lineto(hdcwin&,x&,y&)
invoke LineTo,para1,para2,para3
AsmEnd
AsmStart stern(hdcwin&,radius&,wid&)
.data
Pi180 dq 0.0174532925199433
x Dd 0
y Dd 0
xm Dd 250
ym Dd 250
radius Dq 0.0
wid Dq 0.0
wi Dq 0.0
xmf Dq 250.0
ymf Dq 250.0
.code
finit
mov edx, para3
fld qword ptr [edx]
fst wid
mov edx, para2
fld qword ptr [edx]
fst radius
mov ecx,0
.while ecx<360
Inc ecx
Push ecx
fld wid
fadd wi
fst wi
fmul Pi180
fsin
fmul radius
fadd xmf
fist x
finit
fld wi
fmul Pi180
fcos
fmul radius
fadd ymf
fist y
invoke MoveToEx,para1,xm,ym,0
invoke LineTo,para1,x,y
Pop ecx
.Endw
AsmEnd
EndIf
Window 20,20-600,600
Cls RGB(220,220,220)
bpic& = create("hNewPic", 500,500,rgb(255,255,0))
radius!=250
wid!=1.0
startpaint bpic&
Call(GetXpiaProcAddress(XpiaModule&,"stern"),%hdc,Addr(radius!),Addr(wid!))
EndPaint
drawpic bpic&,30,30;0
WaitKey
end
Alles anzeigen
Wie ich jetzt gelesen habe hat XPIA kein Einfluss ausserhalb von ASM/ENDASM .
Somit wird das XPSE die Sceene bald verlassen, wenn es nicht angepasst wird.
Gruss
Hallo, guten Abend.
Wird XPIA noch geändert auf Freeprofan ?
Die:
Declare longint x,z wird in XPIA nicht erkannt , es meckert rum : Variable nicht deklariert X&
Gruss
Hallo, eine Frage für die Nutzung der mit XPIA erstellten DLL.
Ich möchte gern einmal sehen, wie die BigLib.dll in Profan eingebunden wird und wie die Variablen dort übergeben werden.
Welcher Grundsatz muß beim Erstellen einer DLL beachtet werden, damit ich die in Profan aufrufen kann und mit Variablen Spielen kann.
Danke.
Gruss
Irgendwie steigt man durch den compilierten Code von XPSE nicht durch.
Der ist nicht decomlierbar, sieht auch so Durcheinander aus.
Bei XPIA weiß man, was in ASM umgesetzt wurde.
Ich meine jetzt nicht das ich beide Vergleiche um Kraftwerke zu steuern sondern ich meine die User hier , die mit Profan programmieren, die wahrscheinlich den ASM-Source hassen wie der Teufel das Weihwasser.
Ich habe Zeit (bin Pensionär) und habe mir in wenigen Tagen mal die Mühe gemacht. Aber ich glaube wer im Arbeitsleben steckt , der wird die Zeit da nicht reinstecken zum Spaß um mal ASM-Source zu schreiben.
Zumal die Unterhaltung hier darüber Bände spricht.....wir sind jetzt 3...aber es gibt doch bestimmt über 2000 Profaner und keiner ist hier beim Thema zu finden.
Ich finde es schade, das viel Mühe in XPIA steckt und wenig Unterhaltung darüber.
Gruss
Hab jetzt mal die PlgBLT-Punkte durchrechnet mit XPIA und XPSE :
XPSE 100000 x Schleife : 254 Millisekunden
XPIA 100000 x Schleife : 145 Millisekunden
Wenn man bedenkt was die Programmier-Arbeit in XPIA ist gegenüber XPSE , ist das Resultat von XPSE sehenswert.
XPIA-Test 145 Millisec.:
$MAKE CLE
declare zeit1&,zeit2&,zeit&
Declare xc!,yc!,wh!,winkel!,pts&
dim pts&,24
wh!=100
xc!=50
yc!=50
winkel!=56
if 0
AsmStart rotateplg(xc&,yc&,wh&,winkel&,pts&)
.data
pi180 dq 0.0174532925199433
xc dq 0.0
yc dq 0,0
wh dq 0.0
winkel dq 0.0
z1 dq 0.0
z2 dq 0.0
pts0 dd 0
pts4 dd 0
pts8 dd 0
pts12 dd 0
pts16 dd 0
pts20 dd 0
.code
finit
mov edx, para1
fld qword ptr [edx]
fst xc
mov edx, para2
fld qword ptr [edx]
fst yc
mov edx, para3
fld qword ptr [edx]
fst wh
mov edx, para4
fld qword ptr [edx]
fst winkel
mov ecx,0
.while ecx<100000
Inc ecx
'pts&,0=xc!+(0-xc!)*Cos(Pi180!*winkel!) -(0-yc!)*Sin(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist pts0
'pts&,4=yc!+(0-xc!)*Sin(Pi180!*winkel!)+(0-yc!)*Cos(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist pts4
'pts&,8=xc!+(wh!-xc!)*Cos(Pi180!*winkel!)-(0-yc!)*Sin(Pi180!*winkel!)
finit
fld wh
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist pts8
'pts&,12=yc!+(wh!-xc!)*Sin(Pi180!*winkel!)+(0-yc!)*Cos(Pi180!*winkel!)
finit
fld wh
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist pts12
'pts&,16=xc!+(0-xc!)*Cos(Pi180!*winkel!)-(wh!-yc!)*Sin(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fld wh
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist pts16
'pts&,20=yc!+(0-xc!)*Sin(Pi180!*winkel!)+(wh!-yc!)*Cos(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fld wh
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist pts20
'--------------------------------
mov ebx,para5
Mov eax,pts0
Mov [ebx+0],eax
Mov eax,pts4
Mov [ebx+4],eax
Mov eax,pts8
Mov [ebx+8],eax
Mov eax,pts12
Mov [ebx+12],eax
Mov eax,pts16
Mov [ebx+16],eax
Mov eax,pts20
Mov [ebx+20],eax
.Endw
AsmEnd
endif
WindowTitle " Bitte warten ... teste mit XPIA"
cls
Print ""
Sleep 1000
zeit1& = &GetTickCount
Call(GetXpiaProcAddress(XpiaModule&,"rotateplg"),Addr(xc!),Addr(yc!),Addr(wh!),Addr(winkel!),pts&)
zeit2& = &GetTickCount
zeit& = zeit2& - zeit1&
print "Ausführungsgeschwindigkeit mit XPIA : " + str$(zeit&) + " Millisekunden"
SetText %HWnd,"Geschwindigkeitstest beendet!"
waitinput
end
Alles anzeigen
XPSE 254 Millisec :
{$CLEQ}
declare zeit1&,zeit2&,zeit&
nProc drawhPicRotated()
Float Pi180=0.0174532925199433
Float xc=105.3
Float yc=123.6
Float winkel=157.0
Float wh=100.34
long pts=dim(24)
WhileLoop 1,100000,1
long pts&,0=Long(xc+(0.0-xc)*Cos(Pi180*winkel) -(0.0-yc)*Sin(Pi180*winkel))
long pts&,4=Long(yc+(0.0-xc)*Sin(Pi180*winkel)+(0.0-yc)*Cos(Pi180*winkel))
long pts&,8=Long(xc+(wh-xc)*Cos(Pi180*winkel)-(0.0-yc)*Sin(Pi180*winkel))
long pts&,12=Long(yc+(wh-xc)*Sin(Pi180*winkel)+(0.0-yc)*Cos(Pi180*winkel))
long pts&,16=Long(xc+(0.0-xc)*Cos(Pi180*winkel)-(wh-yc)*Sin(Pi180*winkel))
long pts&,20=Long(yc+(0.0-xc)*Sin(Pi180*winkel)+(wh-yc)*Cos(Pi180*winkel))
EndWhile
dispose(pts)
endproc
WindowTitle " Bitte warten ... teste mit nProc von XPSE"
cls
Print ""
Sleep 1000
zeit1& = &GetTickCount
drawhPicRotated()
zeit2& = &GetTickCount
zeit& = zeit2& - zeit1&
print "Ausführungsgeschwindigkeit mit XPSE: " + str$(zeit&) + " Millisekunden"
SetText %HWnd,"Geschwindigkeitstest beendet!"
waitinput
end
Alles anzeigen
Gruss
Hallo, guten Tag.
Es haben beide eine verschiedene Variablenzuweisung X11.2a und das neue X2.
FreeProfan entspricht den neuem X2.
Es ist keine große Sache das sogenannte umsteigen:
Du entpackst die Freeprofan32 und kopierst die 3 Dateien, die den gleiche Namen haben wie bei X11.2a :
-Prfrun32.exe
-Profan.exe
-profcomp.exe
in deinem XProfan11-Ordner.
fertisch..... nach 3 Minuten ![]()
Gruss
Der Fehler ist mir bei anderen Programmen auch aufgefallen mit XProfan11.2a und auch bei den beiden Programmen oben. Darum habe ich XProfan11.2a in den Schrank verschlossen (Ist eine gekaufte Version vor etwa 2 Jahren).
Ich benutze jetzt FreeProfan32. ![]()
Gruss
Hmm..., jetzt wollte ich die oben noch ändern und geht nicht mehr.
Ich gebe jetzt hier keine Variablen mehr zurück an die PlgBLt sondern nutze die invoke PlgBlt gleich in der XPIA-ASM.
Gruss
' Quellpunkte: AP(0) x--------x AP(1)
' | |
' | |
' ---------
' AP(2) x x [AP(3)] wird automatisch berechent
$MAKE CLE
$H Windows.ph
declare bpic&, bpic1&,bpicbmp&,ende&,hintergrpic&,vordergrpic&,hDCBits&
declare x1!,y1!,dx!,dy!
Declare xc!,yc!,wh!,winkel!,pi180!,dws!
Pi180!=0.0174532925199433
dws!=1.0
wh!=100/dws!
xc!=50/dws!
yc!=50/dws!
ende&=1
bpic& = create("hPic",-1,"d:/freeprofan/test-xpia/data/auto.bmp")
If 0
AsmStart rotateplg(xc&,yc&,wh&,winkel&,hdc&,hDCBits&)
.data
pi180 dq 0.0174532925199433
xc dq 0.0
yc dq 0,0
wh dq 0.0
winkel dq 0.0
z1 dq 0.0
z2 dq 0.0
pts0 dd 6 dup(0)
.code
finit
mov edx, para1
fld qword ptr [edx]
fst xc
mov edx, para2
fld qword ptr [edx]
fst yc
mov edx, para3
fld qword ptr [edx]
fst wh
mov edx, para4
fld qword ptr [edx]
fst winkel
'pts&,0=xc!+(0-xc!)*Cos(Pi180!*winkel!) -(0-yc!)*Sin(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist [pts0+0]
'pts&,4=yc!+(0-xc!)*Sin(Pi180!*winkel!)+(0-yc!)*Cos(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist [pts0+4]
'pts&,8=xc!+(wh!-xc!)*Cos(Pi180!*winkel!)-(0-yc!)*Sin(Pi180!*winkel!)
finit
fld wh
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist [pts0+8]
'pts&,12=yc!+(wh!-xc!)*Sin(Pi180!*winkel!)+(0-yc!)*Cos(Pi180!*winkel!)
finit
fld wh
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist [pts0+12]
'pts&,16=xc!+(0-xc!)*Cos(Pi180!*winkel!)-(wh!-yc!)*Sin(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fld wh
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist [pts0+16]
'pts&,20=yc!+(0-xc!)*Sin(Pi180!*winkel!)+(wh!-yc!)*Cos(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fld wh
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist [pts0+20]
LEA eax,pts0
Invoke PlgBlt,para5,eax,para6,0,0,100,100,0,0,0
AsmEnd
EndIf
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&
UsePen 0,1,Rgb(0,128,255)
usebrush 1,rgb(0,128,255)
ellipse 200,200-250,250
endpaint
dx!=60
dy!=60
startpaint bpic1&
drawhPicRotated
endpaint
zeichne
WHILE ende&
if isKey(83)
y1!=Sin(winkel!*Pi180!)*0.2
x1!=Cos(winkel!*Pi180!)*0.2
dx!=dx!-x1!
dy!=dy!-y1!
zeichne
endif
if isKey(87)
y1!=Sin(winkel!*Pi180!)*0.2
x1!=Cos(winkel!*Pi180!)*0.2
dx!=dx!+x1!
dy!=dy!+y1!
zeichne
endif
if isKey(81)
winkel!=winkel!-0.5
startpaint bpic1&
drawhPicRotated
EndPaint
zeichne
endif
if isKey(69)
winkel!=winkel!+0.5
startpaint bpic1&
drawhPicRotated
EndPaint
zeichne
EndIf
EndWhile
end
Proc zeichne
startpaint vordergrpic&
drawpic hintergrpic&,0,0;0
drawpic bpic1&,dx!,dy!;-1,$ff00ff
EndPaint
drawpic vordergrpic&,10,10;0
EndProc
Proc drawhPicRotated
hDCBits&=~createCompatibleDC(%hDC)
~selectObject(hDCBits&, bpicbmp&)
Call(GetXpiaProcAddress(XpiaModule&,"rotateplg"),Addr(xc!),Addr(yc!),Addr(wh!),Addr(winkel!),%hdc,hDCBits&)
~deleteDC(hDCBits&)
endproc
Alles anzeigen
Hallo, guten Tag.
Jetzt habe ich es geschafft, die PlgBlt in XPIA-ASM umzusetzen.
Es funktioniert. Hab jetzt einiges mit den Fließcommazahlen gelernt.
BMP-Bild hat 64x64 Pixel.
Gruss
' Quellpunkte: AP(0) x--------x AP(1)
' | |
' | |
' ---------
' AP(2) x x [AP(3)] wird automatisch berechent
$MAKE CLE
$H Windows.ph
declare bpic&, bpic1&,bpicbmp&,ende&,hintergrpic&,vordergrpic&,hDCBits&
declare x1!,y1!,dx!,dy!,pts&
Declare xc!,yc!,wh!,winkel!,pi180!,dws!
dim pts&,24
Pi180!=0.0174532925199433
dws!=1.0
wh!=100/dws!
xc!=50/dws!
yc!=50/dws!
ende&=1
bpic& = create("hPic",-1,"d:/freeprofan/test-xpia/data/auto.bmp")
if 0
AsmStart rotateplg(xc&,yc&,wh&,winkel&,pts&)
.data
pi180 dq 0.0174532925199433
xc dq 0.0
yc dq 0,0
wh dq 0.0
winkel dq 0.0
z1 dq 0.0
z2 dq 0.0
pts0 dd 0
pts4 dd 0
pts8 dd 0
pts12 dd 0
pts16 dd 0
pts20 dd 0
.code
finit
mov edx, para1
fld qword ptr [edx]
fst xc
mov edx, para2
fld qword ptr [edx]
fst yc
mov edx, para3
fld qword ptr [edx]
fst wh
mov edx, para4
fld qword ptr [edx]
fst winkel
'pts&,0=xc!+(0-xc!)*Cos(Pi180!*winkel!) -(0-yc!)*Sin(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist pts0
'pts&,4=yc!+(0-xc!)*Sin(Pi180!*winkel!)+(0-yc!)*Cos(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist pts4
'pts&,8=xc!+(wh!-xc!)*Cos(Pi180!*winkel!)-(0-yc!)*Sin(Pi180!*winkel!)
finit
fld wh
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist pts8
'pts&,12=yc!+(wh!-xc!)*Sin(Pi180!*winkel!)+(0-yc!)*Cos(Pi180!*winkel!)
finit
fld wh
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fldz
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist pts12
'pts&,16=xc!+(0-xc!)*Cos(Pi180!*winkel!)-(wh!-yc!)*Sin(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fcos
fmul z1
fst z1
fld wh
fsub yc
fst z2
fld pi180
fmul winkel
fsin
fmul z2
fst z2
fld xc
fadd z1
fsub z2
fist pts16
'pts&,20=yc!+(0-xc!)*Sin(Pi180!*winkel!)+(wh!-yc!)*Cos(Pi180!*winkel!)
finit
fldz
fsub xc
fst z1
fld pi180
fmul winkel
fsin
fmul z1
fst z1
fld wh
fsub yc
fst z2
fld pi180
fmul winkel
fcos
fmul z2
fst z2
fld yc
fadd z1
fadd z2
fist pts20
'--------------------------------
mov ebx,para5
Mov eax,pts0
Mov [ebx+0],eax
Mov eax,pts4
Mov [ebx+4],eax
Mov eax,pts8
Mov [ebx+8],eax
Mov eax,pts12
Mov [ebx+12],eax
Mov eax,pts16
Mov [ebx+16],eax
Mov eax,pts20
Mov [ebx+20],eax
AsmEnd
endif
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&
UsePen 0,1,Rgb(0,128,255)
usebrush 1,rgb(0,128,255)
ellipse 200,200-250,250
endpaint
dx!=60
dy!=60
startpaint bpic1&
drawhPicRotated
endpaint
zeichne
WHILE ende&
if isKey(83)
y1!=Sin(winkel!*Pi180!)*0.2
x1!=Cos(winkel!*Pi180!)*0.2
dx!=dx!-x1!
dy!=dy!-y1!
zeichne
endif
if isKey(87)
y1!=Sin(winkel!*Pi180!)*0.2
x1!=Cos(winkel!*Pi180!)*0.2
dx!=dx!+x1!
dy!=dy!+y1!
zeichne
endif
if isKey(81)
winkel!=winkel!-0.5
startpaint bpic1&
drawhPicRotated
EndPaint
zeichne
endif
if isKey(69)
winkel!=winkel!+0.5
startpaint bpic1&
drawhPicRotated
EndPaint
zeichne
EndIf
EndWhile
end
Proc zeichne
startpaint vordergrpic&
drawpic hintergrpic&,0,0;0
drawpic bpic1&,dx!,dy!;-1,$ff00ff
EndPaint
drawpic vordergrpic&,10,10;0
EndProc
Proc drawhPicRotated
hDCBits&=~createCompatibleDC(%hDC)
~selectObject(hDCBits&, bpicbmp&)
Call(GetXpiaProcAddress(XpiaModule&,"rotateplg"),Addr(xc!),Addr(yc!),Addr(wh!),Addr(winkel!),pts&)
~plgBlt(%hdc,pts&,hDCBits&,0,0,100,100,0,0,0)
~deleteDC(hDCBits&)
endproc
Alles anzeigen