As the standard means to write in the chart at any angle
Posted: Thu Jul 06, 2017 7:50 am
How standard means (without Active X) from Akaska to write in the chart the letters at any angle?
Donnay Software Web Forums
http://bb.mobile.donnay-software.com/Donnay/
http://bb.mobile.donnay-software.com/Donnay/viewtopic.php?f=2&t=2223
Code: Select all
AyName = 'Классиф.шкала: ['+ALLTRIM(STR(mClSc))+']-'+mNameClSc
aMatrix := GraInitMatrix()
GraRotate( oPS, aMatrix, 90, { 40, Y_Max/2+8*LEN(AyName)/2 }, GRA_TRANSFORM_ADD )
oPS:setGraTransform( aMatrix, GRA_TRANSFORM_REPLACE )
GraStringAt( oPS, { 40, Y_Max/2+8*LEN(AyName)/2 }, AyName ) // Надпись оси Y
now sure what goes wrong but :Eugene Lutsenko wrote:The question arises: how to disable the image rotation?
Besides, I in the same picture it is necessary to write and normally horizontally and at an angle.
Code: Select all
//////////////////////////////////////////////////////////////////////
//
// FANCYFNT.PRG
//
// Copyright:
// Alaska Software, (c) 1997-2009. All rights reserved.
//
// Contents:
// This sample program renders some text strings demonstrating the GRA
// engine's GraStringAt() primitive.
//
//////////////////////////////////////////////////////////////////////
#include "appevent.ch"
#include "xbp.ch"
#include "gra.ch"
******************************************************************************
* Main() procedure and event loop
******************************************************************************
PROCEDURE Main
LOCAL nEvent, mp1, mp2, oObj
LOCAL oPS
LOCAL oFont
LOCAL aLineAttrs
LOCAL aStringAttrs
LOCAL aMatrix
LOCAL i
/*
* Setup XbpCrt object created by the AppSys()
* procedure
*/
SetAppWindow():useShortCuts := .T.
SetColor( "N/W+" )
CLS
/* Get presentation space for rendering */
oPS := SetAppWindow():presSpace()
/*
* Rotate text strings to show transforms via
* SetGraTransform()
*/
oFont := XbpFont():new():create("10.Arial Bold")
GraSetFont(oPS , oFont) // установить шрифт
aAttrF := ARRAY( GRA_AS_COUNT )
aAttrF [ GRA_AS_COLOR ] := GRA_CLR_BLACK
aAttrF [ GRA_AS_HORIZALIGN ] := GRA_HALIGN_CENTER // Выравнивание символов по горизонтали по центру относительно точки начала вывода
aAttrF [ GRA_AS_VERTALIGN ] := GRA_VALIGN_HALF // Выравнивание символов по вертикали по средней линии относительно точки начала вывода
GraSetAttrString( oPS, aAttrF )
aMatrix := GraInitMatrix()
FOR i:=1 TO 6
GraRotate( oPS, aMatrix, 60, {200, 200}, GRA_TRANSFORM_ADD )
oPS:setGraTransform( aMatrix, GRA_TRANSFORM_REPLACE )
GraStringAt( oPS, {100,100}, "Повернутый текст..." )
NEXT
oFont := XbpFont():new():create("20.Arial Bold")
GraSetFont(oPS , oFont) // установить шрифт
aAttrF := ARRAY( GRA_AS_COUNT )
aAttrF [ GRA_AS_COLOR ] := GRA_CLR_BLACK
aAttrF [ GRA_AS_HORIZALIGN ] := GRA_HALIGN_LEFT // Выравнивание символов по горизонтали по центру относительно точки начала вывода
aAttrF [ GRA_AS_VERTALIGN ] := GRA_VALIGN_HALF // Выравнивание символов по вертикали по средней линии относительно точки начала вывода
GraSetAttrString( oPS, aAttrF )
GraStringAt( oPS, { 20,200 }, 'Обычный текст после надписей под углом ' )
INKEY(0)
RETURN
// EOF