WebBrowserComponent can't fit to specific bounds


#1

I need to show the full web page with specific bounds. But there have no method in WebBrowserComponent class. I find the windows API imported in JUCE library, and the put_FullScreen & put_Resizable methods in the SDK. but when I call browser->put_FullScreen(true) method and browser->put_Resizable() method, the web page showed in WebBrowserComponent can't fit to the component bounds. I want to check if there already have methods in windows SDK or JUCE code to fit the web page to specific bounds? wait for your response, thanks.


#2

BTW, the effect of the needed methods is the same to the "ZOOM" function of IE.


#3

Sorry, I can't understand what you mean..? If you want the component to be a certain size, just resize the WebBrowserComponent normally (??) There's no need to call directly into the win32 stuff.


#4

I'm sorry no describe this problem clearly.

The code show as bellow:

WebComponent::WebComponent()
{
    _url = "http://www.bing.com";
    int width = getWidth();
    int height = getHeight();
    _webBrowserComponent = new WebBrowserComponent();
    _webBrowserComponent->setBounds(0,0,width,height);
    _webBrowserComponent->goToURL(_url);
    addAndMakeVisible(_webBrowserComponent);
}
void WebComponent::resized()
{
    int width = getWidth();
    int height = getHeight();
    _webBrowserComponent->setBounds(0, 0, width, height);
}
I set the bounds of WebBrowserComponent to certain size and call "goToURL" method to show the page on this component. But the page is more larger than the component size. So it will show scroll bar on the right side and bottom side of this component and just a little part of this web page show in the bounds of this component. I want to show the total web page in the bounds of this component and no scroll bar need to be show. 


#5

The problem picture and picture with needed effect show in the attachment.


#6

What you're asking has nothing at all to do with the way the browser's position, it's entirely a question of making your web content fit inside the browser. It's HTML/JS you need to be changing, not the browser.


#7

I am not familiar with HTML/JS, so I am confused before. Thank you for your response and I will tell my colleague who is responsible for HTML/JS.