|
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
|
|
|
|
|
Hi,
Could you please suggest how to reduce the speed of the Accordian item control. By default it is moving fast. Need to reduce the speed on click of accordian item.
Thanks in advance!
|
|
|
|
|
I don't see any property or method exposed to control the speed.
I imagine you'll need to provide a custom template for AccordionItem.
The default template is in the toolkit source code (AccordionItem.xaml).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
I need to perform some action on AutoGeneratingColumn event of wpf DataGrid.
But i can`t use generated event handlers.So i wonder can i specify somehow(by "gesture")that once AutoGeneratingEvent occurs SomeCommand should be executed.
Smth like:
<toolkit:DataGrid.InputBindings>
<MouseBinding Gesture="LeftDoubleClick" Command="local:RegistryTab.ShowServiceDescriptorDialogCommand"/>
<UnknownBinding Gesture="AutoGeneratingColumn" Command="local:RegistryTab.AutoGeneratingColumnCommand"/>
</toolkit:DataGrid.InputBindings>
|
|
|
|
|
I have a button, and its background image is a bmp file. Background of image is black. How to make this black color transparent
|
|
|
|
|
|
You just could set the transparency mask of the image control that is hosted inside your button ...
The fileformat of the picture hosted inside the imagecontrol is not important at all.
cheers noodles
Tztztztz ....
Sorry, is this a Windows.Forms Button ? If so, my answer is only for WPF ... This comes from quick and dirty reading ...
|
|
|
|