FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Texto vertical
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
Texto vertical
Posted: Sun Apr 23, 2006 04:52 AM
[img=http://img225.imageshack.us/img225/2315/vertical4ts.th.jpg]

Amigos, necesito generar un texto VERTICAL desde recursos, lo estoy intentando con la clase TSay y el Font con NESCAPEMENT, se ve como la imagen.

Alguna sugerencia y/o comentario?

Mil gracias de antemano
William, Morales

Saludos



méxico.sureste
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Texto vertical
Posted: Sun Apr 23, 2006 02:02 PM

William:

A menos de que se trate de un texto variable te sugiero utilices una imágen creada con PaintShop o Corel.

Si es obligatorio el texto, "Juega" con la alineación (Izquierda, Centrado, Derecho, Ajustado) del texto en WS.

Saludos, Armando

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Texto vertical
Posted: Sun Apr 23, 2006 02:38 PM

Si mal no recuerdo la clase del señor MERCADO no hacia texto en cualquier angulo? Tsay creo o algo asi.

Saludos

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 592
Joined: Tue Mar 14, 2006 11:34 PM
Texto vertical
Posted: Sun Apr 23, 2006 10:33 PM

William :

Esta funcion te puede ayudar, pertenece a Cesar Lozada.


  • Function SayRotated(oWnd,Y,X,cPrompt,oFont,nClrText,nClrPane,l3D)
  • Dibuja un texto rotado
  • oWnd: Ventana / diálogo
  • Y,X: coordenadas en pixels del inicio del texto (nTop, nLeft)
  • oFont: Fuente (definir antes) // debe ser True Type
  • nClrText,nClrPane: Colores de texto y fondo. Si éste ultimo es nil se
  • pinta transparente
  • l3D: Con efecto 3D
    *
  • César E. Lozada (cesarlozada@hotmail.com)
  • Los Teques, Venezuela Marzo 25, 2003
    *

include "Fivewin.ch"


Function Test
Local oDlg, oFont1, oFont2
DEFINE FONT oFont1 NAME "Arial" SIZE 0,-36 NESCAPEMENT 9010
DEFINE FONT oFont2 NAME "Arial" SIZE 0,-24 BOLD NESCAPEMENT 45
10

DEFINE DIALOG oDlg FROM 0,0 TO 20,40 COLOR CLR_BLACK,CLR_WHITE;
TITLE "Textos rotados"

ACTIVATE DIALOG oDLg CENTERED;
ON PAINT( SayRotated(oDlg,235,0,"90 grados 3D",oFont1,,,.t.),;
SayRotated(oDlg,125,50,"45 grados",oFont2,CLR_HRED,CLR_YELLOW,.f.))

RELEASE FONT oFont1
RELEASE FONT oFont2
return


Function SayRotated(oWnd,Y,X,cPrompt,oFont,nClrText,nClrPane,l3D)
Local hDC:=oWnd:hDC
DEFAULT nClrText:=CLR_BLUE, l3D:=.T.

IF l3D
DrawRotated(hdc, cPrompt, Y + 1, X + 1, CLR_BLACK,nClrPane,oFont)
DrawRotated(hdc, cPrompt, Y - 1, X - 1, nClrText,nClrPane,oFont)
ENDIF
DrawRotated(hdc, cPrompt, Y , X , nClrText,nClrPane,oFont)

return


Static Function DrawRotated(hDC,cPrompt,Y,X,nClrText,nClrPane,oFont)
Local hOldFont, nOldMode, nOldClrText, nOldClrPane

nOldClrText:=SetTextColor(hDC,nClrText)
if nClrPane<>nil
nOldClrPane:=SetBkColor(hDC,nClrPane)
else
nOldBkMode:=SetBkMode(hDC,1)
endif
hOldFont:=SelectObject(hDC,oFont:hFont)
TextOut(hDC,Y,X,cPrompt,Len(cPrompt))
SelectObject(hDC,hOldFont)
if nClrPane<>nil
SetBkColor(hDC,nOldClrPane)
else
SetBkMode(hDC,nOldBkMode)
endif
SetTextColor(hDC,nOldClrText)
return


Ya la he probado y funciona muy bien.

Espero te sirva.

Saludos

FWH 10.6 + xHarbour + Borland 582
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
Texto vertical
Posted: Mon Apr 24, 2006 04:40 AM

Gracias a todos por contestar, haré las pruebas.

Siempre es bueno saber que contamos con ustedes, gracias por estar.

William, Morales

Saludos



méxico.sureste

Continue the discussion