English
Source / code snippets

display Digits draw

 
iF, Beitrag=56870, Zeitpunkt=22.04.2010
Perhaps. something like:
decimals 0
randomize
window 1000,750
var myDisplayHPic&=digitsHPic.create("012345",32,64)

while 1

    waitinput 500
    drawPic myDisplayHPic&,20,20;0
    digitsHPic.renew(myDisplayHPic&,st$(rnd(999999)),32,64)

wend

...deleteObject(myDisplayHPic&)
end

proc digitsHPic.create

    parameters digits$,charWidth&,charHeight&
    case digits$="" : digits$="0"
    var hPic&=create("hNewPic",len(digits$)*charWidth&,charHeight&,0)
    digitsHPic.renew(hPic&,digits$,charWidth&,charHeight&)
    return hPic&

endproc

proc digitsHPic.renew

    parameters hPic&,digits$,charWidth&,charHeight&
    var c&=len(digits$)
    casenot c& : return
    startPaint hPic&
    cls $3E3E3E
    var lnsz&=int(sqrt(charWidth&*charHeight&)*0.08)
    var innerCharWidth&=int(charWidth&*0.8)
    var innerCharHeight&=int(charHeight&*0.8)
    var innerCharYM&=int(charHeight&*0.5)
    var innerCharX&=int((charWidth&-innerCharWidth&)*0.5)
    var innerCharY&=int((charHeight&-innerCharHeight&)*0.5)
    var digs$="0000000001001010111011011011011101011010111101111101001011111111111011"
    var ch&=""

    whileLoop 0,c&-1

        ch&=(ord(mid$(digits$,&loop+1,1))-48)*7
        digitsHPic.renew.line(0,&loop*charWidth&+innerCharX&+lnsz&,innerCharY& , &loop*charWidth&+innerCharX&+innerCharWidth&-lnsz&,innerCharY& )
        digitsHPic.renew.line(1,&loop*charWidth&+innerCharX&,innerCharY&+lnsz& , &loop*charWidth&+innerCharX&,innerCharYM&-lnsz& )
        digitsHPic.renew.line(2,&loop*charWidth&+innerCharX&+innerCharWidth&,innerCharY&+lnsz& , &loop*charWidth&+innerCharX&+innerCharWidth&,innerCharYM&-lnsz& )
        digitsHPic.renew.line(3,&loop*charWidth&+innerCharX&+lnsz&,innerCharYM& , &loop*charWidth&+innerCharX&+innerCharWidth&-lnsz&,innerCharYM& )
        digitsHPic.renew.line(4,&loop*charWidth&+innerCharX&,innerCharYM&+lnsz& , &loop*charWidth&+innerCharX&,innerCharY&+innerCharHeight&-lnsz& )
        digitsHPic.renew.line(5,&loop*charWidth&+innerCharX&+innerCharWidth&,innerCharYM&+lnsz& , &loop*charWidth&+innerCharX&+innerCharWidth&,innerCharY&+innerCharHeight&-lnsz& )
        digitsHPic.renew.line(6,&loop*charWidth&+innerCharX&+lnsz&,innerCharY&+innerCharHeight& , &loop*charWidth&+innerCharX&+innerCharWidth&-lnsz&,innerCharY&+innerCharHeight& )

    wend

    usepen 0,int(lnsz&*0.25),0
    usebrush 0,0

    whileLoop 0,c&-1

        rectangle &loop*charWidth&,0 - &loop*charWidth&+charWidth&,charHeight&

    wend

    EndPaint

    proc digitsHPic.renew.line

        parameters ln&,x&,y&,xx&,yy&
        usepen 0,lnsz&,if(byte(addr(digs$),ch&+ln&)-48,$22FF11,$4E4E4E)
        line x&,y& - xx&,yy&

    endproc

endproc


Download
external Download




can the too as Control provide.
 
04/22/10  
 



reminds me too one bisl on Cards - Gamecards Include  [...]  ^^ , The Digits can discretionary adorn.
 
04/22/10  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.112 Views

Untitledvor 0 min.
RudiB.08/05/21
Peter Max Müller11/14/17
Georg Teles10/03/17
Heli9806/23/17
More...

Themeninformationen

this Topic has 1 subscriber:

iF (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie