Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic text and image of a box. (Read 1787 times)
pcone
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 9th, 2007
text and image of a box.
Mar 9th, 2007 at 9:06am
Print Post  
hi.

I've fit box' property text and image. But i need that the text of the box is displaied at the bottom of the box, under the image. Is it possible? How?

tanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: text and image of a box.
Reply #1 - Mar 9th, 2007 at 10:17am
Print Post  
Hi,

You could set the ImageAlign property to TopCenter and the TextFormat.LineAlignment to Far. That still does not guarantee that the text and image won't overlap - it depends on the image size. If there is some overlapping, try defining a new ShapeTemplate instance where the ImageRectangle and TextArea are set, e.g. the ImageRectangle to cover the upper 80% of the box, and the TextArea the bottom 20%. Then display the image using the Fit or Stretch alignment, and it should not cover the text.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
pcone
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 9th, 2007
Re: text and image of a box.
Reply #2 - Mar 9th, 2007 at 12:39pm
Print Post  
Very tenks. But now i have this problem.
How can i set Image Rectangle and Text area. When i create a new ShapeTemplete istance i set:

Box.Shape = new ShapeTemplate(
  new ElementTemplate[]
  {
     new LineTemplate(.....)
     .....
  },
  new ElementTemplate[]
  {
     in this part of code i think that i will
     insert code about decorations,the Image i     suppose.
   },
   new ElementTemplate[]
   {
     here i must insert LineTemplate for textArea.
   },
   FillMode,ID)

If the code is correct, i ask you:
How can i set ImageRectangle and TextArea?

Very, very, very Tanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: text and image of a box.
Reply #3 - Mar 9th, 2007 at 1:21pm
Print Post  
Here is some smaple code:

Code
Select All
private void Form1_Load(object sender, System.EventArgs e)
{
	ElementTemplate[] textRect = new ElementTemplate[]
	{
		new LineTemplate(0, 80, 100, 80),
		new LineTemplate(100, 80, 100, 100),
		new LineTemplate(100, 100, 0, 100),
		new LineTemplate(0, 100, 0, 80)
	};

	ShapeTemplate myshape = new ShapeTemplate(
		ShapeTemplate.FromId("Rectangle").Outline, null, textRect, FillMode.Winding, "myshape");
	myshape.ImageRectangle = new RectangleF(0, 0, 100, 80);

	Box test = fc.CreateBox(0, 0, 100, 100);
	test.Style = BoxStyle.Shape;
	test.Shape = myshape;
	test.Image = Image.FromFile(@"D:\Images\1.jpg");
	test.ImageAlign = ImageAlign.Fit;
	test.Text = "myshape test";
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint