using FR Engine SDK 11 can i change the color of rectangle/block?
can i change block/rectangle color?
Was this article helpful?
1 out of 1 found this helpful
using FR Engine SDK 11 can i change the color of rectangle/block?
1 out of 1 found this helpful
Comments
6 comments
Please set appropriate IBlock::UserProperty for such purpose, the property name VisualComponents.BlockColor. Possible code example:
FREngine.IBlock block = Document.Pages[0].Layout.VisualBlocks[0]; block.set_UserProperty("VisualComponents.BlockColor", 0x0000FFFF); imageViewer.Invalidate(true);
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?
page.Layout.Blocks.AddNew(FREngine.BlockTypeEnum.BT_Text, region);
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.
Thanks for your help. very much appreciated.
@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.
Please sign in to leave a comment.