Page 1 of 1

As the standard means to write in the chart at any angle

Posted: Thu Jul 06, 2017 7:50 am
by Eugene Lutsenko
How standard means (without Active X) from Akaska to write in the chart the letters at any angle?

Re: As the standard means to write in the chart at any angle

Posted: Thu Jul 06, 2017 9:03 am
by Auge_Ohr
hi,

not the same but give you a Idea
Rotate_Sign.jpg
Rotate_Sign.jpg (12.63 KiB) Viewed 11967 times
ROTATE.ZIP
pure Xbase++ Source
(1.26 KiB) Downloaded 695 times

Re: As the standard means to write in the chart at any angle

Posted: Thu Jul 06, 2017 8:32 pm
by Eugene Lutsenko
Thank you!

This is sufficient for me to do what I want.

As soon as I saw the text, I remembered that I had read about it, but as it turns out, completely forgot/
Here's another I found:
c:\Program Files (x86)\ALASKA\XPPW32\source\samples\basics\FONT\fancyfnt.prg

Re: As the standard means to write in the chart at any angle

Posted: Wed Jul 12, 2017 11:02 pm
by Eugene Lutsenko
Write text at a given angle turned. But there was another problem. Mode of text rotation is enabled and for subsequent representations of graphical information. How to disable image rotation, or put it into initial state?

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

Re: As the standard means to write in the chart at any angle

Posted: Thu Jul 13, 2017 9:07 pm
by Eugene Lutsenko
I was able to write to the graphics object by the given angle.

However, the formation of the next image turns out the problem:
1) somehow it is inserted in the previous one, and does not create a new;
2) is not formed normally, and rotated;
3) also, after you rotate the image to deteriorate the display of linear and drop-down menus.

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.

Re: As the standard means to write in the chart at any angle

Posted: Sat Jul 15, 2017 2:59 pm
by Eugene Lutsenko
The first picture turns out fine and the other distorted, and should be as shown below.

Re: As the standard means to write in the chart at any angle

Posted: Sat Jul 15, 2017 4:04 pm
by Auge_Ohr
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.
now sure what goes wrong but :
split your work and "save" after each step. than "load" picture again for next step.

Re: As the standard means to write in the chart at any angle

Posted: Sat Jul 15, 2017 8:44 pm
by Eugene Lutsenko
Thank you! It seems to happen to pull what I need from the Alaska example

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
[/size]

Something seems to be starting to understand... Now I will try to use this in a large system. Is not very good

Re: As the standard means to write in the chart at any angle

Posted: Sat Jul 15, 2017 11:01 pm
by Eugene Lutsenko
In General, instead of disable image rotation you can turn up to 360 degrees. Then, then everything seems almost normal. But then not all functions work fine, including the menu (where used DCMENUITEM SEPARATOR).

So a radical solution would be to disable rotation, so that a booth-it was not.