using FR Engine SDK 11 can i change the color of rectangle/block?
can i change block/rectangle color?
- 1.9K Views
- Last Post 14 July 2014
Please set appropriate IBlock::UserProperty for such purpose, the property name VisualComponents.BlockColor. Possible code example:
FREngine.IBlock block = Document.Pages.Layout.VisualBlocks;
As the result first block in Layout will be yellow. The last line: imageViewer.Invalidate is needed to repaint the window.
thank you for this, but how can i change the block color when adding block using below code?
IBloсks::AddNew method requires to specify the position of the newly created block in the blocks collection to be specified in this method call in FRE 11. So you need to add a block and then get this particular block through the ILayout::VisualBlocks collection and then change the block color via UserProperty.
@SDK_support ♦♦ What format has bg color? I know that first two letters are alpha chanel, but I can't set color in standart HEX format. For example 77FF2600 must be red (FF2600 without alpha chanel), but in
imageViewer i see something like blue.
UPD. I find solution. Only deeded invert number, for ex.: 77 alpha chanel and FF2600 color to 770062FF.
Color is specified like int value which is calculated from the RGB triplet using the formula: (red value) + (256 x green value) + (65536 x blue value), where red value is the first triplet component, green value is the second triplet component, blue value is the third triplet component. For example, the int value of the color white equals 16777215.
1348 questions, 4396 answers.