PDA

View Full Version : Object Expansion & Contraction


airwv
08-06-2006, 05:32 PM
I have been looking at an example object expansion and contraction from mina-e.com and was wonder if the same principle can be applied to a label object to increase and decrease the font size. here is the code for the image object expansion:

Size = Image.GetSize("Image1");
Image.SetSize("Image1", Size.Width + 10, Size.Height + 10);
-- Get the size once again, just to be safe
View = Image.GetSize("Image1");
Paragraph.SetText("Paragraph1", "Size Of The Image \r\n".."\r\n".."Height: "..View.Height.."\r\n".."Width: "..View.Width);

Contraction:

Size = Image.GetSize("Image1");
Image.SetSize("Image1", Size.Width - 10, Size.Height - 10);
-- Get the size once again, just to be safe
View = Image.GetSize("Image1");
Paragraph.SetText("Paragraph1", "Size Of The Image \r\n".."\r\n".."Height: "..View.Height.."\r\n".."Width: "..View.Width);

If anyone can point me to an example to do this for the text in a label object would greatly help me out alot. THANKS

Mina
08-06-2006, 05:57 PM
Hi airwv,
Try this


-- Expansion
Size = Label.GetSize("Label1");
Label.SetSize("Label1", Size.Width + 10, Size.Height + 10);
-- Get the size once again, just to be safe
View = Label.GetSize("Label1");
Paragraph.SetText("Paragraph1", "Size Of The Label \r\n".."\r\n".."Height: "..View.Height.."\r\n".."Width: "..View.Width);

-- Contraction
Size = Label.GetSize("Label1");
Label.SetSize("Label1", Size.Width - 10, Size.Height - 10);
-- Get the size once again, just to be safe
View = Label.GetSize("Label1");
Paragraph.SetText("Paragraph1", "Size Of The Label \r\n".."\r\n".."Height: "..View.Height.."\r\n".."Width: "..View.Width);

airwv
08-06-2006, 06:42 PM
wow, THANKS Mina! Exactley what i was wanting it to do! THANKA THANKA