HMG Graph based on Bos Taurus
Moderator: Rathinagiri
-
- Posts: 682
- Joined: Tue Jun 04, 2013 6:33 pm
- Location: Argentina
Re: HMG Graph based on Bas Taurus
Hi Andy:
Wow!!!!!! Excelent.-
Thanks for share your code.-
Eduardo
Wow!!!!!! Excelent.-
Thanks for share your code.-
Eduardo
Re: HMG Graph based on Bas Taurus
Thanks a lot
Re: HMG Graph based on Bas Taurus
HolaBT_DrawText( hDC, Row, Col, cText, cFontName, nFontSize, aFontColor, aBackColor, nTypeText, nAlingText, nOrientation)
No he podido que un texto tenga un fondo de un cierto color según la sintaxis.
Sera algún Bug, alguna idea ?
--------------------------------------------------------------------------------------------
Hello
I could not have a text a background of a certain color according to the syntax.
Will be a Bug, any ideas?
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
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG Graph based on Bas Taurus
Eliminar BT_TEXT_TRANSPARENT de nTypeText
Re: HMG Graph based on Bas Taurus
Gracias Dr. Claudio
Esto significa que si existe la variable "nTypeText",
tiene prioridad sobre lo que se indique como parametro en la función
Porque existiendo "nTypeText" con "BT_TEXT_TRANSPARENT", lo siguiente no pone el BackColor...
-------------------------------------------------------------------------------------------------------------------------
Thanks Dr. Claudio
This means that if the variable "nTypeText"
has priority over what is indicated as a parameter in the function
Because there "nTypeText" with "BT_TEXT_TRANSPARENT", the following does not put the BackColor ...
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 } )
***************************************************************************************************************************************************************
Hice otra prueba, Invirtiendo el orden, si le pone el BackColor en las 3 primeras lineas, pero al minimizar o llamar otra ventana
se pierde el BackColor
-------------------------------------------------------------------------------------------------------------------------------------
I did another test, reversing the order, if you put the BackColor on the first 3 lines, but to minimize or call another window
you lose the BackColor
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 } )
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 )
Esto significa que si existe la variable "nTypeText",
tiene prioridad sobre lo que se indique como parametro en la función
Porque existiendo "nTypeText" con "BT_TEXT_TRANSPARENT", lo siguiente no pone el BackColor...
-------------------------------------------------------------------------------------------------------------------------
Thanks Dr. Claudio
This means that if the variable "nTypeText"
has priority over what is indicated as a parameter in the function
Because there "nTypeText" with "BT_TEXT_TRANSPARENT", the following does not put the BackColor ...
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 } )
***************************************************************************************************************************************************************
Hice otra prueba, Invirtiendo el orden, si le pone el BackColor en las 3 primeras lineas, pero al minimizar o llamar otra ventana
se pierde el BackColor
-------------------------------------------------------------------------------------------------------------------------------------
I did another test, reversing the order, if you put the BackColor on the first 3 lines, but to minimize or call another window
you lose the BackColor
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 } )
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 )
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG Graph based on Bas Taurus
Is a bug,
please in function BT_DRAW_HDC_TEXTOUT (source/c_bostaurus.c, line 1417) change the original code:
for this code:
and rebuild the lib.
please in function BT_DRAW_HDC_TEXTOUT (source/c_bostaurus.c, line 1417) change the original code:
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);
}
Re: HMG Graph based on Bas Taurus
Perfecto Dr. Soto, funciona OK.
Gracias.
Gracias.
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: HMG Graph based on Bas Taurus
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?
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?
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG Graph based on Bas Taurus
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)
Re: HMG Graph based on Bas Taurus
Gracias Dr. Soto !
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.