i have not compare your Xbase++ Code with Pascal Code.
as i can say the Pascal Code only "calculate" Coordinate but does not "paint"
in your Xbase++ Code you still "paint" Pixel by Pixel ... why ?
Code: Select all
FUNCTION Circle(hDC,X0,Y0,R0,nColor)
FUNCTION Line(hDC,X1,Y1,X2,Y2,nColor)
i would use your Code if you compile with /W ... and not using any PUBLIC ...You can correct my source code to correct this problem?
I understand that you did it. Do you understand, what is it?
i did similar "Calculation" with Circle to (quick) rotate a Bitmap.
i also begin with Triangle to get a Point on Circle but it was to slow and not exact.
Code: Select all
R:=sqrt(dx1*dx1+dy1*dy1) // Pythagoras
IF mFlagCircle
Circle(hDC,xo,yo,R,nColorB) // ‘¤¥« âì ®â®¡à ¦¥¨¥ ®ªà㦮áâ¨, ¥á«¨ íâ® § ¤ ®
ENDIF
btw. i can not read "non" ASCI Sign on my System
i think same Way can be used for your Problem.
*** c:\ALASKA\XPPW32\INCLUDE\gra.ch
Code: Select all
LOCAL aMatrix := GraInitMatrix()
LOCAL oPs := ::oStatic2:lockPS()
nCalc1 := nDegrees+(270)
IF nCalc1 > 360
nCalc1 -= 360
ENDIF
nSegment := graSegOpen(oPs)
GraSegClose(oPS)
GraRotate( oPS, aMatrix, nCalc1, {aSize1[1]/2,aSize1[2]/2}, GRA_TRANSFORM_REPLACE )
GraSegDestroy( oPS, nSegment )
cVertices1 := ::DrehX(aMatrix,aSize1,aSize2)