Hello, apologies if I'm really out in orbit </o> </o> My application requires using some of the newer WPF API?s on the server side. Specifically I need to build some big geometries, apply transforms, and then output the results into a jpg/png. All this works on my development server, Windows Server 2003 with .NET 3.5. On DiscountASP.Net I?m getting an error that my app is unable to load WindowsCodec.dll. I?m wondering if there could be some kind of sandboxing going on? Any ideas? - I?ve posted all the code below Thanks! -CG ----------------------- using System;</o> using System.Collections;</o> using System.Configuration;</o> using System.Data;</o> using System.Web;</o> using System.Web.Security;</o> using System.Web.UI;</o> using System.Web.UI.HtmlControls;</o> using System.Web.UI.WebControls;</o> using System.Web.UI.WebControls.WebParts;</o> using System.IO;</o> using System.Windows.Media;</o> using System.Windows.Media.Imaging;</o> using System.Windows.Media.Media3D;</o> </o> namespace TestWPF</o> {</o> public partial class _Default : System.Web.UI.Page</o> {</o> protected void Page_Load(object sender, EventArgs e)</o> {</o> DrawingVisual dv = new DrawingVisual();</o> </o> using (DrawingContext dc = dv.RenderOpen())</o> {</o> System.Windows.Rect r = new System.Windows.Rect(10,10,200,200);</o> dc.DrawRectangle(new SolidColorBrush(Color.FromRgb(255, 0, 0)), null, r);</o> }</o> </o> RenderTargetBitmap rtb = new RenderTargetBitmap(640, 480, 96d, 96d, PixelFormats.Pbgra32); ß this is what throws</o> rtb.Render(dv); </o> </o> using (FileStream outStream = new FileStream(Server.MapPath("testing.png"), FileMode.Create))</o> {</o> PngBitmapEncoder encoder = new PngBitmapEncoder();</o> encoder.Frames.Add(BitmapFrame.Create(rtb));</o> encoder.Save(outStream);</o> }</o> }</o> }</o> }</o> </o>
Hi, No need to apologize, this is some hard stuff to keep straight in our minds. I'm also having a lot of fun with WPF, instantly viewing all media types on Vista with it, including videos. Those methods however are not available to us on the Web, not just yet anyway. According to Scott Guthrie we may be moving in that direction but it will take more work. To use WPF like media effects on the Web you should be using Silverlight. Even that is somewhat crazy because the v2 RTM is still in limbo, a few weeks late now getting to us. What are you using? Blend 2.5? I'm willing to help you with this and once the Silverlight update is out I'll create a few Webcasts. Salute, Mark http://weblogs.asp.net/markwisecarver/
The error indicate that the codec is not installed on the server. Is this a standard codec? Bruce DiscountASP.NET www.DiscountASP.NET
It is standard but System.Windows.Media.Media3D is for working with 3D brushes in WPF. You can even create meshes with it. Pretty cool, but only in Windows. note: The sort of mesh you can create with it are like displacement surfaces.