This interface can be used to provide your own surface implementation and directly handle paint and pixel-scroll events for an IWebView instance.
Assembly: Awesomium.Core (in Awesomium.Core.dll) Version: 22.214.171.124
public interface ISurface : IDisposable
Public Interface ISurface Inherits IDisposable
public interface class ISurface : IDisposable
Thetype exposes the following members.
Called when the size of the view has changed and the surface needs to be re-initialized.
This method is called whenever the IWebView instance this surface is assigned to, wants to paint a certain section of the Surface with a block of pixels. It is your responsibility to copy srcBuffer to the location in this Surface specified by destRect.
This method is called whenever the IWebView instance this surface is assigned to, wants to 'scroll' an existing section of the Surface by a certain offset. It your responsibility to translate the pixels within the specified clipping rectangle (clipRect) by the specified offset.
To specify your own surface implementation (either this is an implementation or a Surface subclass), you need to do any of the following:
- Assign your surface instance to Surface. The instance assigned, should be able to handle changes in size. In particular, Initialize(IWebView, Int32, Int32) is called every time the size of the view changes.
- Handle the CreateSurface event and assign your surface to Surface, whenever the event occurs. The event occurs every time the size of the view changes. You can assign the same surface every time, or a new one (if your implementation cannot handle resizing. All classes deriving Surface that are available with Awesomium.NET, can handle changes in size). Each time CreateSurface occurs, Surface returns the surface previously assigned to the view either through Surface or in an earlier handling of this event, or the default surface for the view if none was previously specified. So even if you do not set Surface when CreateSurface occurs, the view will keep using any previously assigned surface.
|Surfaces are destroyed either manually when they are not needed or internally, when assigned to a view, when the view they are assigned to, is destroyed.|