|
I'm curious...
What if you try four side-by-side renders (similar to the
code at Pixel Snapping in WPF Applications[^])...
1) SnapsToDevicePixels=False, RenderOptions.BitmapScalingMode=Unspecified
2) SnapsToDevicePixels=True, RenderOptions.BitmapScalingMode=Unspecified
3) SnapsToDevicePixels=False, RenderOptions.BitmapScalingMode=NearestNeighbor
4) SnapsToDevicePixels=True, RenderOptions.BitmapScalingMode=NearestNeighbor
Do any of those combinations render the way you'd like?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
None of them is correct. Looks like snapstodevicepoxels has no effect in images at all.
NearestNeighbor always, and it's always blurry without nearestneighbor.
|
|
|
|
|
Hi,
I am new to Silverlight Applications. I created one media player control to play video in asp.net website.I want to drag and drop that media player control to desired place when we run the application but there are no events to drag and drop the video. I tried media element control its working fine for drag and drop functionality but i want that feature in media player control. Is there any other alternatives to drag and drop videos to desired place when we execute the application.
Thanks in Advance
Pavani
|
|
|
|
|
pavanip wrote: I tried media element control its working fine for drag and drop functionality but i want that feature in media player control.
Isn't the MediaPlayer an ASP.NET control?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I used Media Player control in Asp.Net but i am not getting how to Drag and Drop Video to desired location using that media Player control.
|
|
|
|
|
Maybe try posting on the ASP.NET board since it's not a silverlight control.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
ok. thank you i posted it in asp.net,dotnet spider,c# corner forums but i didn't get any reply from those forums. And I tried in another way. I added new silverlight project in sasp.net website and I created media element control in xaml file for drag and drop functionlaity and I used that .XAP file in my aspx page when i run in my local system that page running and i am trying to host it in my iis server and there is no silverlight when i open that link it is showing blank space in place of that xaml content. If you know the reason please suggest me how to host my application in server.
|
|
|
|
|
pavanip wrote: in my iis server and there is no silverlight when i open that link it is showing blank space
Make sure the xap is getting published to your site folder.
Also make sure the appropriate MIME types are configured in IIS:
Configuring IIS for Silverlight Applications[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sir,
i have visual studio 2005. Should i jump to 2008 version to work with wpf..
|
|
|
|
|
I would highly recommend it. You'll get much better designer support
and the .NET 3.5 framework!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I would suggest to even upgrade to .Net 3.5 SP 1 and take advantage of the performance improvements to WPF and goodies like LINQ, Extension methods etc.
modified on Sunday, March 22, 2009 9:17 AM
|
|
|
|
|
Yes... You need to install VS 2008 because VS 2005 does not support WPF...
|
|
|
|
|
OK, I've asked this 6 times on the MSDN forums (they have a lot more WPF traffic ) and got not one reply. So, CPians, here's your chance to shine.
Why does the MediaElement suck ? Am I doing something wrong, because I can't get even a smallish video to play smoothly with sound. Are there settings that improve the performance, because what I get with the default is a joke. I created a simple form with a MediaElement and a button, and got the button to choose a file to play, and even then, the result is choppy ( the video freezes from time to time, the sound is fine ).
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian - it's possible that it's trying to perform software rendering. Try using the WPF profiler to see if that's what's happening here[^]. You might also want to look at hosting the Media Player as an ActiveX control (not an attractive option, but it may be the way to go).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
Hi Pete.
It's been tested on several PCs, so I assume if it's rendering in software, that either there's nothing I can do about it, or that there's something specific I am doing which I could change to make it render in hardware. Which is it ? Can I do anything to make it render in hardware across all machines ? All my machines have excellent video cards ( at least I thought ). They are all XP SP2.
I've actually got it working with the WMP control from C#, but that's created all sorts of issues, the control doesn't like it when I ask it to play a new video after the last one ends, I need to create a timer that asks over and over until it works, and there's all sorts of general rendering glitches, as well as complexity because I need to hide the control before I do any sort of animation. Basically, my app looks like crap now, compared to how it would look if I could render video using WPF.
I will attempt the profiler on my basic app, but I'd appreciate your advice on what I can do about it, if it's rendering in software.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Do I need to download the full Windows Platform SDK to get the performance testing tools ?
It's OK, I found a seperate download.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian,
What format is the media?
Is it getting rescaled during rendering or are you showing it in native size?
Do the results differ if you set the MediaElement's source at runtime or not?
For example, does a simple implementation like:
<MediaElement Source="FILE://E:/Source/Media/Step_into_Liquid_720.wmv" Width="640" Height="480" />
play better than what you're doing?
I get great results with WMV files (icluding HD), both local and streamed, and both on WPF and Silverlight (Mac too!),
and Silverlight doesn't have hardware rendering help. For example, the file
used in the code above is an HD sample - Video: 6500kbps 1280x720 24fps Audio: 384kbps
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: What format is the media?
WMV
Mark Salsbery wrote: Is it getting rescaled during rendering or are you showing it in native size?
Rescaled. We want to play the video within our full screen UI, so size will depend on screen res. I'd have expected that to be a common need.
Mark Salsbery wrote: play better than what you're doing?
That's only marginally simpler than my test app. My test app sets the source in code. I definitely can't be hard coding the source, but could that make a difference ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm just trying to narrow down why you're getting poor performance.
I wouldn't expect lack of hardware rendering on a modern PC to matter much -
it will use more CPU and RAM maybe but it still should play smooth, unless you have
a real low-budget video adapter.
The part I distrust most is setting the source at runtime. The first time
the source is set should be fine, but setting a new source over an old one,
even though it "should" work, may be a problem.
So if you hardwire the source like I showed, just for testing purposes, is the
performance still crappy?
Christian Graus wrote: size will depend on screen res. I'd have expected that to be a common need.
Common need, yes, but have you tried it at native resolution, just to see?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I wrote an app that runs at native resolution for each vid. I think the problem may be that my WMVs are 1200 wide. I think we can go smaller without it looking bad (HD is 1080, DVD is 800 ). I used to download lots of music videos, they are typically 400 wide and they all play great.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian - sorry I haven't got back to you sooner as I've been off CP all weekend. How are you getting on resolving this issue? Do you need more help or have you got it sussed?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
I have a webservice with 3 webmethods.
Now in my client application i want to consume the above service without adding web reference .
In my client application i have url of Web service and webmethods name in the form of strings.
For example: webmethod name: HelloWorld() or add(int x,int y)(Parameterd one)
So i don't want create object for webservice and i don't want to call it as instance.HelloWorld()
I have information of webservice in the form of URL and method name like "HelloWorld"(like string)
I don't know how can I move forward?
Could anyone please provide me the solution?
It is helpful if you can explain with some example code.
|
|
|
|
|
While I wouldn't normally call the web service without a service reference in place, it's a simple enough process. Basically, you have to build the web request yourself and then call it. The following snippet should give you an idea of how it works. I'll leave it to you to work out what your data will be and what your response will be, but this should be a useful starting point:
string data = "xmldocument";
string url = "myurl";
string response = string.Empty;
byte[] buffer = Encoding.ASCII.GetBytes(data);
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
request.Method = "POST";
request.ContentType = "text/xml";
request.ContentLength = buffer.Length;
using (Stream post = request.GetRequestStream())
{
post.Write(buffer, 0, buffer.Length);
post.Close();
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
using (Stream responsedata = response.GetResponseStream())
{
using (StreamReader responsereader = new StreamReader(responsedata))
{
response = responsereader.ReadToEnd();
}
}
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
Hello,
I'm new to WPF and I'm having difficulties with something. In my .xaml file I have a grid with some columns and rows and many controls (labels, buttons, etc.) inside it. In the end I have a frame and I want to be able to scroll inside that frame (since the second column of the grid is bigger that the grid height).
I tried doing something like this:
<ScrollViewer>
<Frame ScrollViewer.CanContentScroll="True" ... />
</ScrollViewer>
but it doesn't work. What am I missing here?
Thanks in advance
<div class="ForumMod">modified on Friday, March 20, 2009 8:56 AM</div>
|
|
|
|
|
AFAIK, SCrollViewer doesn't have a CanContentScroll attached property.
Generally if you wrap an element in a ScrollViewer, you set the wrapped element's
CanContentScroll (where applicable) to false and let the ScrollViewer do the
scrolling.
Can you show a more detailed example - i.e. more XAML showing the grid
surrounding your ScrollViewer?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|