Numer of the color white for created objects.
Hello,
My name is Guilherme and I am have created a macro that creates objects, like a line or a Name, with different collors, depending on the background.
See part of it below.
barra = 12632256
ret = IpAnCreateObj(GO_OBJ_TEXT)
ret = IpAnMove(0, MLx, MLy)
ret = IpAnText("TECMETAL")
ret = IpAnSet(GO_ATTR_FONTSIZE, 17)
ret = IpAnSet(GO_ATTR_FONTBOLD, 1)
ret = IpAnSet(GO_ATTR_TEXTCENTERED, 1)
ret = IpAnSet(GO_ATTR_FONTUNDERLINE, 0)
ret = IpAnSet(GO_ATTR_TEXTCOLOR , barra)
What I need is to create a white object, but I didnt find the number that represents the white color. The number that I used (12632256) gives me a gray object.
Somebody knows which number gives me a white object?
My name is Guilherme and I am have created a macro that creates objects, like a line or a Name, with different collors, depending on the background.
See part of it below.
barra = 12632256
ret = IpAnCreateObj(GO_OBJ_TEXT)
ret = IpAnMove(0, MLx, MLy)
ret = IpAnText("TECMETAL")
ret = IpAnSet(GO_ATTR_FONTSIZE, 17)
ret = IpAnSet(GO_ATTR_FONTBOLD, 1)
ret = IpAnSet(GO_ATTR_TEXTCENTERED, 1)
ret = IpAnSet(GO_ATTR_FONTUNDERLINE, 0)
ret = IpAnSet(GO_ATTR_TEXTCOLOR , barra)
What I need is to create a white object, but I didnt find the number that represents the white color. The number that I used (12632256) gives me a gray object.
Somebody knows which number gives me a white object?
0
Answers
-
Hello,
The correct number for pure white in decimal is 16777215 or FFFFFF in hex. An easier method of specifying color values is to use QColor() and RGB() functions that provide the values to use as shown below that generate the same number for white. These functions are documented in the IPBasic help file for reference.
barra = RGB(255,255,255)
barra = QBColor(15)0 -
The color is in &HBBGGRR format in hexadecimal notation, so white will be &HFFFFFF
here is the exampleSub TestAnnot()Dim barra As Long'color is in &HBBGGRR formatbarra = &H0000FF'redbarra = &HFFFFFF'whiteret = IpAnShow(1)ret = IpAnCreateObj(GO_OBJ_TEXT)ret = IpAnMove(0, 54, 98)ret = IpAnText("MyText")ret = IpAnSet(GO_ATTR_TEXTCOLOR, barra)End Sub
Yuri
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions