LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I rotate a text

Hi.

How can a rotate a text message or a text into a graph. I need to rotate it 90 degree or 45.

Thanks.
0 Kudos
Message 1 of 7
(5,613 Views)
I'll give you a proposal for a subset of your needs, hoping that somebody else can give us a simplest solution 😉

When I wanted to draw text on a panel rotated 90 degrees I developed the attached routine that:
- accepts a control ID as an input
- gets the control bitmap, rotates it 90 degrees counter-clockwise
- puts the rotated bitmap on a picture control

It's not exactly what you want but can be easily modified to put the rotated bitmap on the graph in the desired position with PlotBitmap.

Two problems with this solution:
1. The bitmap cannot hold the transparent color, so the plotted image will retain its background. I.E.: don't expect to be able to draw a text and see other plots below it...
2. It rotates only by 90°. While it is easy to recalculate the function for rotating in other directions or by 180° or 270°, rotating by a fraction of a square angle is too far from my comprehension of BMP standard for me to be able to do it 😞

Hope these 2c can help you a little
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 7
(5,588 Views)
Hello,

There is an example program titled Rotate Text in LabWindows/CVI Using the Canvas Control that uses a technique similar to the one described by Roberto.

This should be a very good starting point for your application.

Scott Y
NI
Message 3 of 7
(5,552 Views)

Dear Roberto,

 

 

   Can u plz upload the .uir file with the .c file for the rotate a bitmap image.

0 Kudos
Message 4 of 7
(4,591 Views)

This is a very old thread, and CVI has seen many new releases since then. Nowadays you can rotate text programmatically very simple using the attribute ATTR_TEXT_ANGLE, or directly in the UI editor, see the figure below.

 

rotated text.png 

 

 

0 Kudos
Message 5 of 7
(4,587 Views)

Dearer's,

 

 

           I want to rotate the bitmap image based on given angle, which can be loaded in a file. So i want to read each pixels of that image and then i need to rotate it. Kindly provide few solutions in CVI, to accomplish my application.

0 Kudos
Message 6 of 7
(4,547 Views)

Follow this new topic here



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 7 of 7
(4,525 Views)