using FR Engine SDK 11 can i change the color of rectangle/block?

asked 24 Feb '14, 10:07

vbknight's gravatar image


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.


answered 27 Feb '14, 19:09

SDK_support's gravatar image

SDK_support ♦♦

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);

(28 Feb '14, 09:25) vbknight

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.

(28 Feb '14, 15:58) SDK_support ♦♦

Thanks for your help. very much appreciated.

(04 Mar '14, 06:17) vbknight

@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.

(09 Jul '14, 13:13) beta-tank

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.

(14 Jul '14, 13:02) SDK_support ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 24 Feb '14, 10:07

Seen: 1,890 times

Last updated: 14 Jul '14, 13:02

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal