Bild als Kreis einblenden von ??? |
Kleines Beispiel um ein Bild was die selbe größe hat wie der benutzte Bildmodus kreisförmig einzublenden . Hab ich geschrieben um meine gerenderte Geburtstagstorte zu präsentieren , weil Küche ist für mich ein Fremdwort *G* Alles selbst gemacht 8) [img:51bf49b896]http://home.kamp.net/home/r15502/Torte.jpg[/img:51bf49b896] [code:1:51bf49b896] Graphics 1600,1200,16,1 SetBuffer BackBuffer() ;-------------------------------------------------- Global pic=LoadImage("ChTorte.bmp") Global mas=CreateImage(GraphicsWidth(),GraphicsHeight()) MaskImage mas,255,0,255 ;-------------------------------------------------- Global block=CreateImage(40,40) SetBuffer ImageBuffer(block) Color 32,32,32 Rect 0,0,40,40 Color 64,64,64 Rect 0,0,20,20 Rect 20,20,20,20 SetBuffer BackBuffer() ;-------------------------------------------------- TileBlock block,0,0 Flip WaitKey If KeyHit(1) Then End FlushKeys Zeigen FlushKeys ;-------------------------------------------------- While Not KeyHit(1) ;ESC If KeyHit(28) Then ;Return zeigen:FlushKeys EndIf Delay 20 Wend End ;-------------------------------------------------- Function mCircle(mx,my,r,Fill) r=r*2 Oval mx-r/2,my-r/2,r,r,Fill End Function ;-------------------------------------------------- Function Zeigen() Local i,i1 Local dx,dy dx=GraphicsWidth() /2 dy=GraphicsHeight()/2 Local h=Sqr(dx*dx+dy*dy) For i=1 To h+5 Step 1 DrawBlock pic,0,0 ;Bild SetBuffer ImageBuffer(mas) TileBlock block,0,0 ;Füllung ;Kreis Rand Color 255,255,0 mCircle GraphicsWidth()/2,GraphicsHeight()/2,i+2,True ;Transparenter Kreis Color 255,0,255 mCircle GraphicsWidth()/2,GraphicsHeight()/2,i,True SetBuffer BackBuffer() DrawImage mas,0,0 Flip Delay 10 Next End Function ;-------------------------------------------------- [/code:1:51bf49b896] |