Page 4 of 10

Re: HMG Graph based on Bas Taurus

Posted: Mon Oct 05, 2015 12:57 pm
by EduardoLuis
Hi Andy:

Wow!!!!!! Excelent.- ;)
Thanks for share your code.-
Eduardo

Re: HMG Graph based on Bas Taurus

Posted: Wed Oct 07, 2015 11:26 pm
by Steed
Thanks a lot

Re: HMG Graph based on Bas Taurus

Posted: Thu Oct 08, 2015 3:31 am
by andyglezl
BT_DrawText( hDC, Row, Col, cText, cFontName, nFontSize, aFontColor, aBackColor, nTypeText, nAlingText, nOrientation)
Hola

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 

Re: HMG Graph based on Bas Taurus

Posted: Thu Oct 08, 2015 6:38 pm
by srvet_claudio
Eliminar BT_TEXT_TRANSPARENT de nTypeText

Re: HMG Graph based on Bas Taurus

Posted: Thu Oct 08, 2015 7:38 pm
by andyglezl
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 )

Re: HMG Graph based on Bas Taurus

Posted: Fri Oct 09, 2015 12:40 am
by srvet_claudio
Is a bug,
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);
for this code:

Code: Select all

   if ((Type & BT_TEXT_TRANSPARENT) == BT_TEXT_TRANSPARENT)
       SetBkMode(hDC, TRANSPARENT);
   else
   {   SetBkMode(hDC, OPAQUE);
       SetBkColor(hDC, Back_Color);
   }
and rebuild the lib.

Re: HMG Graph based on Bas Taurus

Posted: Fri Oct 09, 2015 2:36 am
by andyglezl
Perfecto Dr. Soto, funciona OK.
Gracias.

Re: HMG Graph based on Bas Taurus

Posted: Mon Oct 12, 2015 6:25 pm
by andyglezl
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?

Re: HMG Graph based on Bas Taurus

Posted: Mon Oct 12, 2015 7:25 pm
by srvet_claudio
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?
See:

Code: Select all

hBitmapNew := BT_BitmapClone (hBitmap, Row, Col, Width, Height)

Re: HMG Graph based on Bas Taurus

Posted: Mon Oct 12, 2015 8:39 pm
by andyglezl
Gracias Dr. Soto !