Hi,
I need to draw a rectangle on a window with an outline of a certain color and thickness. How to do it ?
Hi,
I need to draw a rectangle on a window with an outline of a certain color and thickness. How to do it ?
Natter wrote: Hi,
I need to draw a rectangle on a window with an outline of a certain color and thickness. How to do it ?
#include "fivewin.ch"
function Main()
local oWnd
// Define the window
DEFINE WINDOW oWnd TITLE "Rectangle Example" SIZE 640, 480
// Set the pen color and thickness for the rectangle border
oWnd: SetPen( RGB(255, 0, 0), 3 ) // Red color, 3 pixels thickness
// Set the brush color for the rectangle fill (optional)
oWnd: SetBrush( RGB(0, 255, 0) ) // Green fill (you can also use a transparent fill)
// Draw the rectangle with specific coordinates
oWnd: DrawRect( 100, 100, 500, 300 ) // x1, y1, x2, y2
// Show and activate the window
ACTIVATE WINDOW oWnd
returnThanks, I'll give it a try !
function TestBox()
local oWnd
local aRect := { 60,100,300,400 }
local nBrdThick := 2
local nBrdColor := CLR_HRED
local nRectFill := CLR_YELLOW
DEFINE WINDOW oWnd SIZE 600, 500 PIXEL
oWnd:bPainted := { || FW_Box( oWnd, aRect, { nBrdColor, nBrdThick }, nRectFill ) }
ACTIVATE WINDOW oWnd CENTERED
return nilThanks Rao, good solution !