Wow!!!!!! Excelent.-

Thanks for share your code.-
Eduardo
Moderator: Rathinagiri
HolaBT_DrawText( hDC, Row, Col, cText, cFontName, nFontSize, aFontColor, aBackColor, nTypeText, nAlingText, nOrientation)
Code: Select all
#include "hmg.ch"
FUNCTION MAIN
DEFINE WINDOW Win1 AT 0,0 WIDTH 600 HEIGHT 400 MAIN ON PAINT Proc_ON_PAINT () BACKCOLOR { 47, 79, 79 } TITLE "Prueba BT_DrawText()"
END WINDOW
CENTER WINDOW Win1
ACTIVATE WINDOW Win1
RETURN Nil
PROCEDURE Proc_ON_PAINT
LOCAL nTypeText, cText
LOCAL hDC, BTstruct
LOCAL i1, nRen := 0, nCol := 0
hDC = BT_CreateDC( "Win1", BT_HDC_INVALIDCLIENTAREA, @BTstruct)
* BT_DrawText( hDC, Row, Col, cText, cFontName, nFontSize, aFontColor, aBackColor, nTypeText, nAlingText, nOrientation)
nTypeText := BT_TEXT_TRANSPARENT + BT_TEXT_BOLD // + BT_TEXT_ITALIC + BT_TEXT_UNDERLINE
BT_DrawText( hDC, 100, 100, "Valor" , "Verdana", 10, BLUE, WHITE, nTypeText, BT_TEXT_LEFT )
BT_DrawText( hDC, 150, 100, "Otro Valor", "Verdana", 10, BLACK, WHITE, BT_TEXT_OPAQUE, BT_TEXT_LEFT )
BT_DrawText( hDC, 200, 100, "Otro más" , "Verdana", 10, WHITE,,, )
DrawTextInBitmap( hDC, 250, 100, "Otro más", 'Arial', 10 , WHITE, 0, { 70, 130, 180 } )
BT_DeleteDC (BTstruct)
RETURN
function DrawTextInBitmap( hDC, Row, Col, cText, cFontName, nFontSize, aColor, nAlign, aColor2 )
default nAlign := 0
do case
case nAlign == 0
BT_DrawText( hDC, Row, Col, cText, cFontName, nFontSize, aColor, aColor2 )
case nAlign == 1
BT_DrawText( hDC, Row, Col, cText, cFontName, nFontSize, aColor, aColor2, BT_TEXT_RIGHT )
case nAlign == 2
BT_DrawText( hDC, Row, Col, cText, cFontName, nFontSize, aColor, aColor2, BT_TEXT_CENTER )
endcase
return nil
Code: Select all
if ((Type & BT_TEXT_TRANSPARENT) == BT_TEXT_TRANSPARENT)
SetBkMode(hDC, TRANSPARENT);
else
SetBkColor(hDC, Back_Color);
Code: Select all
if ((Type & BT_TEXT_TRANSPARENT) == BT_TEXT_TRANSPARENT)
SetBkMode(hDC, TRANSPARENT);
else
{ SetBkMode(hDC, OPAQUE);
SetBkColor(hDC, Back_Color);
}
See:andyglezl wrote:Hola Dr. Soto
Tenemos en BosTaurus (ó podríamos tener) una función que COPIE una región ( ren, col, ancho, alto ) de un hBitmap y crear otro hBitmap ?
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
We Bos Taurus (or could have) a function that copies a region (ren, col, width, height) of an HBITMAP and create another hBitmap?
Code: Select all
hBitmapNew := BT_BitmapClone (hBitmap, Row, Col, Width, Height)