Ich mache eine "Kreis" mit
Code: Alles auswählen
GraArc(::oPS,aPos,nRadius,,,,GRA_FILL)
16:10 LCD sieht der "Kreis" eher "plattgedrückt" aus.
Ist das "normal" ? wie macht man den unter 16:10 einen "Kreis" ?
gruss by OHR
Jimmy
Moderator: Moderatoren
Code: Alles auswählen
GraArc(::oPS,aPos,nRadius,,,,GRA_FILL)
Code: Alles auswählen
#include "Xbp.ch"
#include "Appevent.ch"
#include "gra.ch"
PROCEDURE APPSYS
RETURN
PROCEDURE MAIN
LOCAL aSize := AppDesktop():currentSize()
LOCAL aCenter := { aSize[1]/2 ,aSize[2]/2 }
LOCAL nRadius := (aCenter[2]/10)-2
LOCAL nEvent, mp1, mp2, oXbp
LOCAL oDlg, oPS
oDlg := XbpDialog():new( ,, {0,0}, aSize )
* oDlg:title := "Circle on 16:10 Monitor"
oDlg:titlebar := .F.
oDlg:border := XBPDLG_NO_BORDER
oDlg:tasklist := .T.
oDlg:create()
oDlg:drawingArea:setColorBG( GRA_CLR_BLACK )
oPS := XBpPresSpace():New()
oPS:Create(oDlg:drawingArea:WinDevice())
oDlg:drawingArea:paint := {|| DrawGraphic(oPS,aCenter,nRadius ) }
nEvent := 0
DO WHILE nEvent <> xbeP_Close
nEvent := AppEvent( @mp1, @mp2, @oXbp )
IF nEvent == xbeP_Keyboard .and. mp1 == xbeK_ESC
EXIT
ENDIF
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
PROCEDURE DrawGraphic( oPS,aCenter,nRadius )
LOCAL aAttr := ARRAY(GRA_AL_COUNT)
LOCAL i := 0, iMax
LOCAL aSize := AppDesktop():currentSize()
LOCAL aStart, aEnd
aAttr[GRA_AL_MIXMODE] := GRA_FGMIX_XOR
FOR i:=1 TO 10
aAttr[GRA_AL_COLOR] := i+1
oPS:setAttrLine(aAttr)
GraArc( oPS ,aCenter, INT(nRadius*i) ) // Kreis zeichnen
NEXT
aAttr[GRA_AL_COLOR] := 8
oPS:setAttrLine(aAttr)
i := 0
iMax := aSize[1]/10
FOR i:=0 TO aSize[1] STEP iMax
aStart := {i,0}
aEnd := {i,aSize[2]}
GraLine(oPS,aStart,aEnd)
NEXT
i := 0
iMax := aSize[2]/10
FOR i:=0 TO aSize[2] STEP iMax
aStart := { 0,i}
aEnd := {aSize[1],i}
GraLine(oPS,aStart,aEnd)
NEXT
RETURN
tatsächlich hab ich es überprüft : Du hast Recht !!!Wolfgang Ciriack hat geschrieben: evtl. Auflösung richtig einstellen