Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBC] Rounded Rectangle Function

Author
Message
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 15th Oct 2007 19:48
This function creates a rounded rectangle. The function input data are:
1: left X co-ordinate
2: top Y co-ordinate
3: right X co-ordinate
4: bottom Y co-ordinate
5: radius of rounded corner
6: border thickness
7: rgb red value of foreground colour
8: rgb green value of foreground colour
9: rgb blue value of foreground colour
10: Background on/off
11: rgb red value of background colour
12: rgb green value of background colour
13: rgb blue value of background colour
14: Bitmap which is copied to the new bitmap
15: The new bitmap on which the rectangle is temporarily drawn (must not exist)
16: Bitmap to which the rectangle is finally drawn


This is the function:



Example programme of how to call it:




And yeah I know the huge amount of variables is kind of overkill but I have wanted this for a few things now, so I wanted it to be as flexible as possible for any project I might need it in.

http://jamesmason01.googlepages.com/index.htm
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Oct 2007 15:56
Well, I guess that works...

I'll give you my version which is a little bit shorter:
But it only supports filled boxes...



or calling:


It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.

Login to post a reply

Server time is: 2024-11-22 13:26:17
Your offset time is: 2024-11-22 13:26:17