LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating Height and Width of Text String in 6.1

We have a vi that uses a CIN. It takes in a specified font and string
and x,y origin and calculates the rectangular area of the given text.
We have been using this VI since LabVIEW 4. Unfortunately, it will not
work in LV6.1 and causes the compatexport.cpp error documented at NI.
It works in 6.0.2, but not in 6.1. I believe that this VI was
downloaded from somewhere, but the name was changed long ago. I'm
wondering if anyone has a simiar VI that works with LV 6.1.

When I choose the create .c file I get:

/*
* CIN source file
*/

#include "extcode.h"

/*
* typedefs
*/

typedef struct {
LStrHandle Font_Name_;
int16 Size;
LVBoolean Strikeout_;
LVBoolean Italic_;
LVBoolean Underline_;
LVBoolean Outline_;
LVBool
ean Shadow_;
LVBoolean Bold_;
uInt16 desired_font_application_;
} TD1;

typedef struct {
int16 horizontal;
int16 vertical;
} TD2;

CIN MgErr CINRun(LStrHandle text, TD1 *_user_specified_font_, int32
*var3, TD2 *origin_0_0_);

CIN MgErr CINRun(LStrHandle text, TD1 *_user_specified_font_, int32
*var3, TD2 *origin_0_0_) {

/* ENTER YOUR CODE HERE */

return noErr;
}
0 Kudos
Message 1 of 4
(4,008 Views)
There is a picture function "Get Text Rect.vi" that has this functionality.


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 4
(4,008 Views)
Jean-Pierre Drolet wrote in message news:<5065000000050000005F5F0000-1012609683000@exchange.ni.com>...
> There is a picture function "Get Text Rect.vi" that has this
> functionality.

Great. Thanks. That looks like the one.
0 Kudos
Message 4 of 4
(4,008 Views)
There is a vi in the picture library called "Get Text Rect.vi" that will give you a cluster of the four points that make up the rectangle around a given text string with the provided font. I'm attaching a small example that demonstrates this.

Brian
0 Kudos
Message 3 of 4
(4,008 Views)