Windows Phone 7 transparent WebBrowser - windows-phone-7

I want to a have a transparent WebBrowser component to be displayed on top of other components. I have been trying with a transparent Background WebBrowser property, different transparent colors for html page, but it doesn't seem to work.
It is any way in which I can do this?

You can't apply transparency to a WebBrowser control because it's not a "true" Silverlight control. It's a native control in a Silverlight wrapper so that it can be used LIKE a regular Silverlight control.
As a wrapped native control it handles its drawing itself and doesn't go through the Silverlight drawing pipeline and so can't have transparency applied at that time. As it doesn't make sense for the web browser to include transparency when used as a standalone app it doesn't have this facility built in and so can't be used when used in an embedded manner.
For workarounds, see the answers at Making WebBrowser Transparent

Related

Full UI widget toolkit rendering in WebGL

Is there currently any full widget toolkit providing components rendering in WebGL only? Similar to the ZebraUI project, which renders a full UI component set in HTML5 canvas?
The idea is to write pure JavaScript, and still be able to shaders to render the components.
There is a new open source project which supports complete rendering of all widgets using WebGL: The DreemGL toolkit. Here is a screenshot of a DreemGL application. All UI elements are rendered using WebGL (including fonts). It's still alpha or beta quality.

WebBrowser div scrolling

If I limit WebBrowser's height, and content is longer, scrollbar is created inside the WebBrowser (effectively, HTML page is long), similar to IE in WP7. This scrollbar behaves the way I want to - after swift swipe it continues to scroll, slowing down.
But if I place a div with a scrollbar in the WebBrowser content, this scrollbar behaves like regular HTML scrollbar, it does not keep scrolling after user stops touching the display.
Is there a way to make this work too ?
Thanks
No, not easily. The WP7 IE9 browser control supports the overflow:scroll CSS property that allows the user to scroll content within the current page. It is worth noting that most Android and iPhone browsers do not support this, although it has been added in iOS5. None of these browser support inertia scrolling for overflow:scroll, WP7 included.
The only way to get inertia scrolling for overflow content is to do it yourself using JavaScript. For WebKit browsers there is a popular library, iScroll, that provides this functionality. However, it does not work for WP7 (due to lack of CSS3 3D transforms that are used to push the scrolling content onto a different layer for hardware acceleration) - so you will need to write your own implementation. Good luck!

How does a Windows non-native user interface work?

Through experience I have found that the native windows forms/components don’t like to be changed. I know using Delphi or Visual Studio you are given native windows components to populate a form or window with and then you attach code on events that these components may do (onClick for example).
However, how do all of these programs like Word or google’s Chrome browser alter the standard windows’ window? I thought it was somehow protected?
Chrome seems to have tabs actually on the window’s frame?
I know you can also get toolkits like Swing and QT that have their own controls/components to populate a form. How do these work? (How does the operating system/computer know what a non-native button should act like? For example; Chrome's back and forward buttons, they're not native components?).
I can understand how OpenGL/DirectX window would work because you’re telling the computer exactly what to draw with polygons/quads.
I hope this question is clear!
Windows does not protect GUI elements. Windows and controls can be subclassed to handle various drawing operations in a custom way. For example, windows may override and reimplement the handling of the WM_NCPAINT message to draw a custom titlebar and frame:
http://msdn.microsoft.com/en-us/library/dd145212(VS.85).aspx
Some Windows controls have an "owner-draw" mode. If you use this, you get to draw the control (or at least vital parts of the control), while Windows takes care of responding to user input in the standard way.
Swing ant QT draw their own widgets at a low level using basic primitives, but they also have theme engines which can mimic the native controls.
Qt moved to native controls a while back. As for how swing does it, it gets a basic window from the OS. Then much like Opengl\Directx it does all of the drawing with in that window. As for where to position things that is what the layout managers do. Each manager has a layout style horizontal, vertical, grid, components it has to draw and a section of window it is expected to fill. From there it does some pretty easy math to allocate its space to its controls.
There's no magic: non native controls are simply drawn on a blank window. Or, instead of being drawn they may be represented as one of several bitmaps based on state (ie: a button may be represented as a .png for the normal state, another .png for the pressed state, etc)

Creating a Custom Silverlight Designer in WPF

I need to create a designer for Silverlight in WPF and I’m thinking of a few options
Use a WebBrowser control,
display the content there and
communicate Silverlight using the
JavaScript Bridge. Not sure if this
will be enough for the scenarios I
need to support (see below). This is what KaXaml is doing. SilverlightSpy uses a a more sophisticated WebBrowser control, but I'm not sure how they communicate with Silverlight.
Communicate using Sockets
between the Host and Silverlight.
Host the Silverlight runtime (not in
a browser), but directly using
AgCore.dll. Similar to what sllauncher does for OOB. I imagine
this is what Blend/VS are doing.
Do whatever Blend or VS are doing
which.
I obviously don’t want to go as far as VS and Blend, but I need to support drag and drop of some controls as well as grouping, changing the layout, moving controls in the design surface and obviously updating the Xaml as a result of this actions.
Any ideas, recommendations or pointers on the best way to create a Silverlight Designer in WPF?
SharpDevelop 4 has a WPF based editor for WPF and Silverlight -> http://www.icsharpcode.net/opensource/sd/

modal window with non square borders

How do I make modal windows with non square borders, for instance a modal window which has a corner to indicate it's coming (sorta being shout) from a text.
Create your modal dialog window as you would normally and then call SetWindowRgn API to set the non-rectangular region you want to achieve.
Note that this will not allow you to do semi-transparent effects, it works only for opaque windows. If you want alpha blending, your window has to be top-level (alpha transparency is not supported for child windows) and you should be usign different APIs.
Also, this works for C++ clients using the native Win32 API. If you are writing C#/VB.Net code, you need to specify if you are using WinForms or WPF, as the solution is different for these.

Resources