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

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#1 Post by Eugene Lutsenko »

How standard means (without Active X) from Akaska to write in the chart the letters at any angle?
Attachments
1232725009_15000000.jpg
1232725009_15000000.jpg (86.37 KiB) Viewed 11984 times

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

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

#2 Post by Auge_Ohr »

hi,

not the same but give you a Idea
Rotate_Sign.jpg
Rotate_Sign.jpg (12.63 KiB) Viewed 11981 times
ROTATE.ZIP
pure Xbase++ Source
(1.26 KiB) Downloaded 696 times
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#3 Post 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

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#4 Post 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
Attachments
Inf1-0002-0001rot.jpg
Inf1-0002-0001rot.jpg (28.19 KiB) Viewed 11907 times
Inf1-0002-0001.jpg
Inf1-0002-0001.jpg (30.23 KiB) Viewed 11907 times
Inf1-0001-0001rot.jpg
Inf1-0001-0001rot.jpg (28.46 KiB) Viewed 11907 times

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#5 Post 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.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#6 Post by Eugene Lutsenko »

The first picture turns out fine and the other distorted, and should be as shown below.
Attachments
Inf3-0002-0001-PosNeg-bad.jpg
Inf3-0002-0001-PosNeg-bad.jpg (30.85 KiB) Viewed 11859 times
Inf3-0002-0001-PosNeg.jpg
Inf3-0002-0001-PosNeg.jpg (137.02 KiB) Viewed 11859 times
Inf3-0001-0001-PosNeg.jpg
Inf3-0001-0001-PosNeg.jpg (28.7 KiB) Viewed 11859 times

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

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

#7 Post 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.
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#8 Post 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
Attachments
Безымянный.jpg
Безымянный.jpg (44.07 KiB) Viewed 11854 times

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#9 Post 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.

Post Reply