Good day. There is a task to display captions vertically. Using only C language features. I understand that the standard output of a string or character does not allow to rotate 90 degrees. Have to draw a character. Has anyone come across this? I found the implementation of drawing a character pixelically but classically horizontally. I can not guess how to convert X and Y coordinates to display the same symbol but vertically? The output algorithm is something like this.

for (TempByte0000= 0x00; TempByte0000 < Π¨Ρ€ΠΈΡ„Ρ‚Ρ‹_Π¨Ρ€ΠΈΡ„Ρ‚[ΠšΠΎΠ΄Π¨Ρ€ΠΈΡ„Ρ‚Π°].Π—Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊΠ¨Ρ€ΠΈΡ„Ρ‚Π°.ВысотаБимвола; TempByte0000++) for (TempByte0001= 0x00; TempByte0001 < Π¨Ρ€ΠΈΡ„Ρ‚Ρ‹_Π¨Ρ€ΠΈΡ„Ρ‚[ΠšΠΎΠ΄Π¨Ρ€ΠΈΡ„Ρ‚Π°].Π—Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊΠ¨Ρ€ΠΈΡ„Ρ‚Π°.Π¨ΠΈΡ€ΠΈΠ½Π°Π‘ΠΈΠΌΠ²ΠΎΠ»Π°; TempByte0001++) { Π’ΠΈΠ΄Π΅ΠΎ_Π£ΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒΠŸΠΈΠΊΡΠ΅Π»ΡŒ(ΠŸΠΎΠ·ΠΈΡ†ΠΈΡX + TempByte0001, ΠŸΠΎΠ·ΠΈΡ†ΠΈΡY + TempByte0000, Π¦Π²Π΅Ρ‚0000); } 
  • I would look for already deployed fonts and draw them. - avp
  • one
    Using only the capabilities of the C language , you do not have the means to display graphics. So tell me what kind of graphics framework you use. - VladD

1 answer 1

The idea is this:

 ΠΠΎΠ²Π°ΡΠŸΠΎΠ·ΠΈΡ†ΠΈΡX = ΠŸΠΎΠ·ΠΈΡ†ΠΈΡY; ΠΠΎΠ²Π°ΡΠŸΠΎΠ·ΠΈΡ†ΠΈΡY = -ΠŸΠΎΠ·ΠΈΡ†ΠΈΡX; 

It will be clockwise.

 ΠΠΎΠ²Π°ΡΠŸΠΎΠ·ΠΈΡ†ΠΈΡX = -ΠŸΠΎΠ·ΠΈΡ†ΠΈΡY; ΠΠΎΠ²Π°ΡΠŸΠΎΠ·ΠΈΡ†ΠΈΡY = ΠŸΠΎΠ·ΠΈΡ†ΠΈΡX; 

It is counterclockwise.

  • my area is not divided into quarters. I have one area where X: 0-800 Y: 0-600. Somewhere there will be a symbol for example in the place of 300x300, it is drawn horizontally. if I make a New Item Y =-Position X; then go for the coordinate ots. How can I do this within my 800x600 area? - Aldmi
  • You draw in (0,0), after calculating the next coordinate you shift it to the place of drawing. For example, I figured out what to draw in (1.5), now you shift it to (1 + 300.5 + 300). And so every point. - IVS