I would like to draw a rounded filled rect, without making circles and boxes (becouse if I make circles and boxes, the result si not alpha-compatible.
Any suggestion on how to do that?
Any suggestion on how to do that?
Function DrawRoundRect:TImage(x:Int, y:Int, width:Int, height:Int, radius:Int) DrawOval(x, y, radius, radius) DrawOval(x + (width - (radius)), y, radius, radius) DrawOval(x, y + (height - (radius)), radius, radius) DrawOval(x + (width - (radius)), y + (height - (radius)), radius, radius) DrawRect(x + (radius / 2), y, width - radius, height) DrawRect(x, y + (radius / 2), width, height - radius) Return LoadImage(GrabPixmap(100,100,100,100),FILTEREDIMAGE|MIPMAPPEDIMAGE) End Function Graphics 640,480 'drawroundrect(100,100,100,100,10) 'image:TImage=LoadImage(GrabPixmap(100,100,100,100),FILTEREDIMAGE|MIPMAPPEDIMAGE) image:TIMAGE=drawroundrect(100,100,100,100,10) Cls DrawImage image,0,0 Flip WaitKey()