3

I'm using http://awesomium.com/ (1.7 RC2) for the webview and http://perspective.codeplex.com/ for the 3d objects.

XAML:

<p:Workshop3D>
    <p:Spherical3D ParallelCount="30" DefaultTextureMapping="True">
        <p:Spherical3D.Material>
            <DiffuseMaterial>
                <DiffuseMaterial.Brush>
                    <ImageBrush TileMode="None" Stretch="Fill" 
                                ImageSource="{Binding Path=WebTexture, ElementName=MyWpfWindow}" />
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
        </p:Spherical3D.Material>
    </p:Spherical3D>
</p:Workshop3D>

Code Behind:

public MainWindow()
{
    _webView = WebCore.CreateWebView(800, 600);
    _webView.LoadURL(new Uri(@"http://www.youtube.com"));

    while (_webView.IsLoading)
        WebCore.Update();

    var buffer = (BitmapSurface)_webView.Surface;
    var bitmap = new WriteableBitmap(800, 600, 96, 96, PixelFormats.Bgra32, null);
    buffer.CopyTo(bitmap.BackBuffer, 800, 4, false, false);

    WebTexture = bitmap;

    InitializeComponent();
}

private ImageSource _webTexture;
public ImageSource WebTexture
{
   get
   {
      return _webTexture;
   }
   set { _webTexture = value; RaisePropertyChanged("WebTexture"); }
}

For some reason the get accessor for WebTexture isn't even being called, so I'm guessing I'm missing something here (2 hours of google/bing/duckduckgo didn't bring up anything either).

duckflambe
  • 31
  • 3
  • When you say the GET request isn't even being called, are you talking about your call to `_webView.LoadURL()`? Watching the traffic with a debugging proxy shows the request being sent. What are you seeing that makes you think it's not being called? – HotN Jul 26 '12 at 15:07
  • Thanks for the reply. The _webView.LoadURL is fine, but the GET accessor for WebTexture is not getting called. – duckflambe Jul 26 '12 at 23:25

0 Answers0