|
Wow - that's not insane at all.......
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yeah gotta wonder why it was left out.
But who wants to use the OS windows in WPF anyway
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
True - we always generate a fake title bar so we can style it. Another weird oversight, IMO.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi
In design u set the code like ResizeMode="CanMinimize"
|
|
|
|
|
|
I have a WPF image viewing program that I thought for sure was automatically using ICC color profiles imbedded in bitmap images. I thought this for two reasons: (1) I never found any properties in classes like Image, JpegBitmapDecoder, or TiffBitmapDecoder that let you specify whether color profiles are used, so I thought it just did it by default; (2) None of my beta testers ever complained. In fact I had one raving about the high quality of image rendering my app had on his high gamut monitor, and I also have a high gamut monitor where the images just knock your socks off. But I now suspect that the colors look accurate only because the images use the sRGB color space.
In a previous app using GDI+, I had to explicitly tell GDI+ to use ICC color profiles by passing true for the icm parameter of various Bitmap constructor overloads, and it was obvious that this was working, because when I used Adobe RGB for my TIFF files and sRGB for my JPEG files and I A/B'd them, there was no perceptable color difference. If they were not used, the TIFF files would appear washed out because sRGB is used by default if you don't explicitly tell GDI+ to use ICC color profiles. They appear washed out because Adobe RGB has a wider color gamut than sRGB.
But when I specifically A/B'd the same under my WPF application, I was appalled to see that the ICC color profiles built into the images were not being used! My sRGB images looked great and my Adobe RGB imaes looked washed out, whereas in Photoshop they looked the same. Now WPF is touted to be an outstanding replacement for GDI+ applications that Windows Forms and C++/MFC applications were forced to use.
What is really surprising is that the BitmapFrame class (the class I use to display images) has a ColorContexts property that has the ICC color profiles! So why wouldn't it be using them??? This is a read-only property and there doesn't seem to be any other property that would tap the BitmapFrame class on the shoulder and say, "Hey, use your ColorContexts property to display the bitmap, dummy."
Since it has the ICC color profiles right there in front of it, I find it impossible to believe that WPF does not have a way of telling its visual layer to use them. If it doesn't, this would be an application killer of a defect and I'm just sunk: nine months of development down the drain! Please tell me I'm just blind and have somehow missed the property that I must set to get WPF to use ICC color profiles! What is it that I have to do?
modified on Friday, October 2, 2009 9:12 PM
|
|
|
|
|
You need to use one of the BitmapEncoder classes (not the BitmapDecoder classes) and set the ColorContext through that.
"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 | Onyx
|
|
|
|
|
I'm not sure how your suggestion applies. I'm taking image files straight out of Photoshop that already have ICC profiles imbedded in them, getting a BitmapFrame from them (through static member, BitmapFrame.Create()) and actually displaying the image though a statement like the following:
image.Source = BitmapFrame;
where "image" is an instance of the Image class and is imbedded in a Grid.
I have told my camera to use the Adobe RGB profile and Photoshop finds that profile in the TIFF files that I save. Then in a separate step, I tell Photoshop to convert the profile to sRGB, and save the result as a JPEG. Re-reading the files into Photoshop shows that the TIFF files do indeed have Adobe RGB and the JPEG files do indeed have sRGB, and they look virtually the same in Photoshop. But when I use the above technique for reading and displaying the TIFF and RGB files in my application, the TIFF files lose saturation, a typical result from ignoring the imbedded profile and applying sRGB by default, as many WEB applications do.
|
|
|
|
|
Imagine an ItemsControl that is a fixed width. Each item is a grid with a fixed width as well.
Let's say each grid item is 200 pixels wide, so when generated in the items control it's like:
Name: Value
Name: Value
Name: Value
Value is dynamically rendered. I host it inside a content control, like this:
<ContentControl Content="{Binding Converter={ControlConverter}}" HorizontalAlignment="Stretch"/>
Inside the converter, I might return a TextBox, a PasswordBox, a CheckBox, etc.
The problem I'm having is that I am setting the width of these like so:
return new TextBox() { HorizontalAlignment=HorizontalAlignment.Stretch };
Of course I'm setting other properties but you get the gist.
Unfortunately, the resulting controls are sizing themselves to the content, not the container.
The stretch basically isn't working the same as if I have a actual TextBox in place of the content control.
Anyone have an idea of why the stretch isn't working? Should I wire into some event and rebind the size somehow or make it dependent on the parent control (perhaps pass the parent as a parameter?)
Thanks,
Jeremy
|
|
|
|
|
Have you tried setting the ContentControl's HorizontalContentAligment
to Stretch?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Worked perfectly, thank you!
|
|
|
|
|
I have to realize a binding like this
<br />
<TextBlock Text="{local:mybinding Path=folder1.folder2.item}" FontSize="16"/><br />
<br />
in the Path I have a string but this doesn't correspond to an object tree,
I would dynamically attach a real object that corresponds to this string.
example folder1.folder2.item1 I create an object obj1=new MyObject("folder1.folder2.item1")
example folder1.folder2.item2 I create an object obj2=new MyObject("folder1.folder2.item2")
obj1 and obj2 are the real objects I want bind.
Maybe it's possible with ExtensionMarkup but Silverlight 3 doesn't support it, do it?
Do you have any solution?
|
|
|
|
|
Fabrizio Camagna wrote: <TextBlock Text="{local:mybinding Path=folder1.folder2.item}" FontSize="16"/>
folder1.folder2.item is a path to a string or do you want to specify the string in markup?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
is a path that rappresent a tree path of my "custom namespace" but the objects don't exist
before I parse this string.
I'd like parse this string and create these objects.
|
|
|
|
|
Maybe you could use a converter...
public class MyObject
{
public MyObject(string str)
{
}
}
public class StringToObjectConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
string str = (string)parameter;
return new MyObject(str);
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
<UserControl.Resources>
<local:StringToObjectConverter x:Name="StringToObjectConverter" />
</UserControl.Resources>
...
<TextBlock Text="{Binding Converter={StaticResource StringToObjectConverter}, ConverterParameter=folder1.folder2.item}" FontSize="16"/>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I'm just starting out using WPF and I'm wanting to make a small application to help our sales staff for the end of day paperwork.
What I want to do it have a GUI that the users will type information into and then run some automatic calculations which I'm pretty sure I can do. But when the information in all entered and correct I want them to click SAVE and this will output all the information that they enetered into a sheet and store in a container of some sort.
For example, it's the the of day, I enter in all the days sales etc, calculations have run I click on save, the stuff just entered I want exported and automatically save to a PDF, or HTML file or something.
What would I need to look into so when I click the save button the action is done?
|
|
|
|
|
The most obvious way to do this is to make a class that contains all of the data on a form, and use serialisation to store it. Or you can write your own code to store in XML. To get a PDF, you need to buy a library. You can write HTML if you want to. I'd write XML and write an XSLT to show it as HTML.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello guys
anyone knows the difference between HttpContext.Current.Items and HttpContext.Current.Application when it comes to storing objects to be shared between services.
|
|
|
|
|
Items stores values on a per request basis, whereas Application stores them as long as the application is available.
"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 | Onyx
|
|
|
|
|
|
I guess WPF is now mainstream enough for this forum to be filling with ignorant people, just like the others
priyagee wrote: i am new to wpf
Then you should buy a book and read it.
priyagee wrote: i need to open microsoft word document
Do you mean open inside your program ? What makes you think WPF can do that ?
priyagee wrote: in ribbontoolbar button click
There's a WPF ribbon bar control ? The control you use doesn't really make any difference, or are you saying you don't know how to handle a click event, either ?
priyagee wrote: Can anyone help me .
I doubt it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Priyagee,
If you click on the Office Button (the round button in the far left hand corner of the screen), it is the second option on the drop down menu. Just hover over the word “Open”.
Please let me know if you have any other questions.
Cheers,
MSOffice Canada
|
|
|
|
|
Want to get started writing applications on Silveright[^]?
MSDEV brings you a series of training videos on Silverlight 3 at Microsoft Silverlight 3 Series[^]. This series of on demand web seminars will walk through the technology fundamentals, data, graphics, and .NET RIA Services of Silverlight 3.
In addition, you can get training at XAMLFest Online[^].
|
|
|
|
|
If you wish to advertise your wares here then you should pay the site's advertising rates. And since you apparently work for Microsoft, that should not be a problem!
|
|
|
|
|
Good job Bruce.
"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 | Onyx
|
|
|
|