Page 1 of 1

OSR Browser question

Posted: Mon Sep 14, 2020 6:21 pm
by Briskitte Bardot
Hi,
I've been looking at the SimpleOSRBrowser demo, and don't fully understand it.
The demo uses the same TChromium component as MiniBrowser, and it displays the websites on screen. What is it that makes it OSR?
Can the visible browser be used to login and browse to a specific webpage, and then "clone" that page in OSR mode with a different resolution? If I for example, would like to render a webpage at a resolution of 2000x3000, which is bigger than my screen.

Re: OSR Browser question

Posted: Tue Sep 15, 2020 8:53 am
by salvadordf
Briskitte Bardot wrote: Mon Sep 14, 2020 6:21 pm Hi,
I've been looking at the SimpleOSRBrowser demo, and don't fully understand it.
The demo uses the same TChromium component as MiniBrowser, and it displays the websites on screen. What is it that makes it OSR?
The OSR demos have a totally different way to show the web contents. Those demos get the raw bitmap data in the TChromium.OnPaint event and the application shows that data in a custom panel.

A browser in OSR mode also uses some methods and events to handle the screen properties, mouse events, keyboard events, etc.
Briskitte Bardot wrote: Mon Sep 14, 2020 6:21 pm Can the visible browser be used to login and browse to a specific webpage, and then "clone" that page in OSR mode with a different resolution? If I for example, would like to render a webpage at a resolution of 2000x3000, which is bigger than my screen.
As I commented before, your application would have to use a TChromium event to inform the browser about the screen properties : size, scale, etc.
https://github.com/salvadordf/CEF4Delph ... r.pas#L432

Read this for more information about the events used in OSR mode :
https://magpcss.org/ceforum/apidocs3/pr ... ndler.html

Re: OSR Browser question

Posted: Tue Sep 15, 2020 7:25 pm
by Briskitte Bardot
Thank you very much for pointing me in the right direction. :)
One mistake I made was not noticing that the OSR demo used a TBufferPanel instead of a TCefWindowParent. Now I know how to proceed, with both this and the question I had in another thread about reloading a canvas.
I don't promise I won't be back with other questions though. ;)