Incredible! Getting the Platform Update for Vista installed did the trick! Thank you so much for sticking with me! So this is probably not a problem under Windows 7, and I don't think there's a fix for it under XP. I'll have to document that in my application.
Im glad that fixed it, I thought that was kind of a long shot really. I tried scaling an Image control and using RenderTargetBitmap and didn't notice any quality degradation so that might be a workaround for xp, there are some other options like System.Drawing aswell.
The code you supplied does work and at least superficially (without "pixel-peeping") provides good quality. Of course the following line does not compile:
Insincere Dave wrote:
but can be replaced with code that does and the scaled image file does not contain artifacts, even on an XP system.
In Googling, I was surprised by how many people can't get RenderTargetBitmap to work, complaining of blank images. I tried some of the code posted that supposedly works and I also got blank images, and solutions posted that supposedly fixed the blank images did not work. But your code works, and I never saw anyone post that solution. Where did you get it, or did you just figure it out? The code I've seen posted is also considerably more complicated than what you posted.
In any case, I now have software rendering code that I can use for XP systems and Vista systems not up to SP2. Once again, thank you very much.
I'm not even going to try the WIC solution because I don't want to contaminate my application with COM code.
I can't remember where I first saw code using RenderTargetBitmap, you need to call measure and arrange if the item hasn't been added to the visual tree otherwise it's not necessary. WPF uses WIC so that patch might still be applicable but I don't know if it will fix the issue.
Thanks for the explanation for using Measure and Arrange. I'm still trying to get my head around those two functions.
I haven't performed any measurements, but using software rendering doesn't appear to be all that much slower than using the video card, even on my wife's entry level PC running XP. (It does have 2 GB RAM, however.) I guess modern PC CPU's rival video card GPU's for simple things like bitmap rendering. So I'm not (yet) motivated to see whether the new WIC for XP solves the problem. I suspect it does, but I'm thinking, so what? Software rendering seems to be working fine in my application.
Hi, i am not sure if this is a good place to ask the following, but...
is there a method to export/import a playlist into Windows Media Player (10 and above?)
I'm creating a media manager database in Access 2007. I will have a collection of various files (audio, video, images, .PPT, .DOC, ..). If i could build a playlist containing a collection of my files, I want a format that can be imported into Windows Media Player.
I see iTunes has a feature that allows Import/Export of a playlist and thought something might also exist in the Microsoft environment.
If anyone have any idea to do this please reply me.
I created one WPF dll usig C#.And im using that in VC++.I added that WPF control.dll through add reference.
But i nedd is, when i click the button in that WPFcontrol.dll,it should invoke the fucntion in vc++.
If i created one MFC dialog in VC++,when i press that button in WPF control,it should show the dialog created in vc++.
How can i do that. Pls help me.
I have not seen WPF so I may be wrong here.
You should, if possible, create a delegate for the button click in your WPF dll. Then, wherever you use that dll, handle the click event in the parent form/page.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
I have an object called "user" on the codebehind of a mainpage that shows if is anyone signed up on the webpage. The structure of the silverlight app is: a mainpage and a navigation:frame inside. I want to access to public object "user" from the navigation frame. the navigation frame is a xaml navigation:page.
First - your URI @"C:\Dokumente und Einstellungen\THI\Desktop\stage2.xml"
is not going to work. Silverlight runs on the client and does not allow
direct access to the client's file system without asking the user first,
using the OpenFileDialog class.
The XmlReader.Create() method that takes a URI string only works for files
packaged in the Silverlight application's XAP file.
If the XML file you need to open is on the client's computer, you
need to use OpenFileDialog, not HttpWebRequest.
So where is the XML file you need to load?
I dont understand how to write the RequestState class and i dont understand what is: allDone.WaitOne() or allDone.Set()
All web requests in Silverlight are asynchronous. That means
the request is sent, processing continues, and at some later time
when a reply is received, the app is notified.
The example code you linked to uses an EventWaitHandle to wait
on the requesting thread until the reply is received, then continues
processing, essentially making the web request synchronous. IMO
it's a bad example - a reply could take many seconds, so if the
request is made on the UI thread, you've halted the UI thread,
which could lead to a bad user experience.
allDone is an EventWaitHandle or one of its derived classes, so if
you're new to threading, you may want to look at that documentation.
The RequestState can be anything you want - an existing object of any
class. Its purpose is to allow you to pass something across the asynchrounous
call. Whatever object you pass in the request will be available to you in the
Microsoft MVP - Visual C++
Last Visit: 31-Dec-99 18:00 Last Update: 25-Sep-23 11:14