This is a migrated thread and some comments may be shown as answers.

Fitting Control to 100% width and 100% height

2 Answers 108 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 20 Jul 2011, 09:29 PM
Hello

I would like to fit the ImageEditor control to 100% of the available space on the page. However when I set the height to 100% and the width to 100% it makes the control look all funny. What setting do I do to fit the control in 100%.

Regards,
Simon

2 Answers, 1 is accepted

Sort by
0
Simon
Top achievements
Rank 1
answered on 20 Jul 2011, 10:23 PM
I have managed to get this code to resize the control nicely.


window.onload = onWindowLoad;
        window.onresize = onWindowResize;
 
        function onWindowLoad() {
 
            setTimeout("document.getElementById('imgEditor').style.width = (getWindowWidth() - 10) + 'px';", 500);
            setTimeout("document.getElementById('imgEditor').style.height = (getWindowHeight() - 10) + 'px';", 500);
            setTimeout("document.getElementById('imgEditor_Viewport').style.height = (getWindowHeight() - 80) + 'px';", 500);
             
        };
 
        function onWindowResize() {
 
            document.getElementById("imgEditor").style.width = (getWindowWidth() - 10) + 'px';
            document.getElementById("imgEditor").style.height = (getWindowHeight() - 10) + 'px';
            document.getElementById("imgEditor_Viewport").style.height = (getWindowHeight() - 80) + 'px';
 
        }
 
0
Rumen
Telerik team
answered on 22 Jul 2011, 11:48 AM
Hi Simon,

Thank you for sharing your code with the community.

I just want to add that we will provide support for Width and Height values in percents for the next Q2 2011 SP1 build of RadImageEditor.

Greetings,
Rumen
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ImageEditor
Asked by
Simon
Top achievements
Rank 1
Answers by
Simon
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or