Nevron Forum

Prevent text wrapping or image resizing

https://www.nevron.com/Forum/Topic6557.aspx

By Rotha Aing - Wednesday, June 13, 2012

Hello,

I need to generate shapes with a bitmap and text label underneath. The issue is that I want to have the image retain a certain size and for the text underneath to not become wrapped.

Currently I am using a ImageFillStyle and I have tried replacing the default label on the shapes with a NLogicalLineLabel but this causes the drawing view to show some weird graphics trail when moving the shape around (and a bit of performance hit).

Thanks
By Nevron Support - Wednesday, June 13, 2012

Hi,

For your scenario you can take advantage of the table shape. For example, to create a table shape with an image and a text underneath you can use the following piece of code:

NTableShape table = new NTableShape();

document.ActiveLayer.AddChild(table);

table.ShowGrid = false;

table.InitTable(1, 2);

table.BeginUpdate();

 

table[0, 0].Bitmap = new Bitmap(@"D:\Image.png");

table[0, 1].Text = "Sample Text";

 

table.EndUpdate();

table.Location = new NPointF(100, 100);

Note that table shapes are not resizable. They are automatically sized to fit their content.