|
Well, that update I mentioned (KB937286) wasn't the Platform Update for Vista, but something that just came out today. Also, VS 2010 doesn't solve the problem. I converted my little application to VS 2010 and the problem still shows up. I guess I'll have to keep searching for the download page for the Platform Update for Vista. I don't know why the Microsoft download page doesn't show up when I Google for it, only a bunch of pages that mention that it's been released, and I haven't found any of those pages giving the link to the download page.
|
|
|
|
|
|
Yes, I found that link and followed the instructions. I didn't find a reference to the Platform Update for Vista. So I investigated further and saw that before the Platform Update can be installed, you have to have Vista SP2 installed, which I didn't! As I type, it is ready to be installed. After it gets installed, 971644 will hopefully show the Platform Update available for installation. Right now I have to shut everything down before the SP2 installation will start!
|
|
|
|
|
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.
|
|
|
|
|
Insincere Dave wrote: I tried scaling an Image control and using RenderTargetBitmap and didn't notice any quality degradation
I'm probably doing something wrong. Is your code small enough to quote here so I can see how you did this?
|
|
|
|
|
There is a recent update for WIC for xp that might contain the fix.
This code might still cause the artifact you could try setting the BitmapScalingMode if it does.
void ScaleUsingRTB(string inFile, string outFile, double scale)
{
Uri uri = new Uri(inFile);
BitmapImage bitmapImage = new BitmapImage(uri);
var image = new Image
{
Source = bitmapImage, Width = bitmapImage.PixelWidth*scale, Height = bitmapImage.PixelHeight*scale
};
image.Measure(new Size(image.Width,image.Height));
image.Arrange(new Rect(0,0,image.Width,image.Height));
RenderTargetBitmap rtb = new RenderTargetBitmap((int) image.Width, (int) image.Height, 96, 96, PixelFormats.Pbgra32);
rtb.Render(image);
Save(outFile,rtb);
}
|
|
|
|
|
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: Save(outFile,rtb);
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,
Any idea how to increase/decrease the horizontal spacing between the nodes in a treeView??
Thank you guys!
|
|
|
|
|
Maybe adjust the left margin on the element that displays the node.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I adjusted Padding on the Label that I put in the node and my problem has solved
|
|
|
|
|
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.
Thanks.
|
|
|
|
|
|
This is a silverlight forum, so unless you are doing something with it, this is not the best place to ask this question.
The Lounge[^] may be a good place to bring this up (so long as you're dont discuss any code related issues there).
|
|
|
|
|
Hi,
I am working on a silverlight application. In this I created a silverlight page named Page.xaml. Then this silverlight page is used or embedded in a aspx page named Home.aspx. In Home.aspx I wrote javascript function. This javascript function should be called whenever I click on the button in Page.xaml.
i.e., on clicking a button in Page.xaml I have to call the javascript function in Home.xaml provided Page.xaml is in Home.aspx and all these are in a same project.
If anyone have any idea to do this please reply me.
Thanks in advance.
|
|
|
|
|
|
|
Hi Nekkantidivya,
Use HtmlPage.Window.Invoke() method to give the JavaScript call from your silverlight application.
Suppose the name of your javascript method is: SayHello(), then call the following from your button click event implementation:
HtmlPage.Window.Invoke("SayHello");
Let me know if you have any issues.
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
Hi,
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++.
Eg:
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.
Anu
|
|
|
|
|
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...!!
|
|
|
|
|
Hi there!
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.
How can i do it from the codebehind?
thnks!
|
|
|
|
|
Application.Current.RootVisual will get you the top level element from
anywhere in the code.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
And the codebehind too? Ok, thank you, when i finish my work time i will prove it
|
|
|
|