// Using: GDIPLUS.
#include "FiveWin.ch"
#define PAD_LEFT 0
#define PAD_RIGHT 1
#define PAD_CENTER 2
FUNCTION BoxRed() // CAIXA REDONDA - BOXROUND.
LOCAL oPrn, oFont, oFont2, oFont3, oPen, oPen1, oPen2, oPen3
LOCAL oBrush, oFondo
LOCAL ResLinha, ResColuna, nLinha, nColuna
LOCAL nLinBox, nColBox, nAltBox, nTamBox, lBorEsq, lBorDir
PRINT oPrn NAME "Ejemplo de caja redondeada" PREVIEW
DEFINE BRUSH oBrush COLOR nRGB(250,213,174) // Bello
DEFINE BRUSH oFondo COLOR CLR_GRAY // HGRAY
// DEFINE PEN oPen WIDTH 2 OF oPrn
DEFINE PEN oPen WIDTH 2 COLOR CLR_CYAN OF oPrn
Define Pen oPen1 Width 25 COLOR nRgb( 192, 192, 192 ) OF oPrn
DEFINE PEN oPen2 WIDTH 2 COLOR CLR_BROWN OF oPrn
DEFINE PEN oPen3 WIDTH 50 COLOR nRgb( 192, 192, 192 ) OF oPrn
DEFINE FONT oFont NAME "Arial" SIZE 0, - 6 BOLD OF oPrn
DEFINE FONT oFont2 NAME "Arial" SIZE 0, - 12 BOLD Underline OF oPrn
DEFINE FONT oFont3 NAME "Arial" SIZE 0, - 18 BOLD OF oPrn
ResLinha := oPrn:nLogPixely() / 2.54
ResColuna := oPrn:nLogPixelx() / 2.54
PAGE
nLinha := 2.25
nColuna := 9.50
nLinBox := 1.60 // Linha que Inicia o Box
nColBox := 5.50 // Coluna que inicia o Box
nAltBox := 3.50 // Altura do Box
nTamBox := 13.60 // Tamanho(Largura) do Box horizontal
lBorEsq := 90 // Bordas arredondadas esquerda.
lBorDir := 90 // Bordas arrendondadas direita.
Box_Round( nLinBox , nColBox , nAltBox, nTamBox, oPrn, lBorEsq, lBorDir, oPen, oFondo )
oPrn:Say( nLinha * ResLinha, nColuna * ResColuna, ;
+ "DESCRIZIONE DOCUMENTO", oFont2,, CLR_BLACK,, PAD_CENTER )
nLinha := nLinha + .80
oPrn:Say( nLinha * ResLinha, nColuna * ResColuna, ;
+ "FiveWin is invincible.", oFont,, CLR_BLACK,, PAD_CENTER )
ENDPAGE
ENDPRINT
oBrush:End()
oFondo:End()
oPen:End()
oPen:release()
RETURN nil
FUNCTION Box_Round( nArriba, nIzq, nAbajo, nDerecha, oPrn, a, b, oPen, oBrush )
LOCAL hOldPen, xCor := {} , yCor := {}
LOCAL hOldBrush
// Pasamos coordenadas de cms a pixel
xCor := oPrn:Cmtr2Pix(nArriba,nIzq)
yCor := oPrn:Cmtr2Pix(nAbajo,nDerecha)
// Guardamos el Lapiz y la brocha que teniamos
hOldPen := SelectObject( oPrn:hDcOut, oPen:hPen )
hOldBrush := SelectObject( oPrn:hDcOut, oBrush:hBrush )
//Dibujamos el rectangulo redondeado
roundrect(oPrn:hdcOut,xCor[2],xCor[1],yCor[2],yCor[1],a,b)
// y seleccionamos el que habiamos guardado
selectObject( oPrn:hDcOut, hOldPen )
selectObject( oPrn:hDcOut, hOldBrush )
RETURN NIL
#IFDEF __HARBOUR__
DLL FUNCTION RoundRect( hDC AS LONG, ;
iLeft AS _INT , iTop AS _INT, ;
iRight AS _INT, iBottom AS _INT, ;
iWidth AS _INT, iHeight AS _INT ) AS BOOL PASCAL LIB "GDI32.DLL"
#ELSE
DLL FUNCTION RoundRect( hDC AS WORD, ;
iLeft AS _INT , iTop AS _INT, ;
iRight AS _INT, iBottom AS _INT, ;
iWidth AS _INT, iHeight AS _INT ) AS BOOL PASCAL LIB "GDI.EXE"
#ENDIFRegards.










