|
How im I reading it into the memory in my code?
The big problem is that If I set imageStorage.Source = null; the source is null but the picture still has a height and width which means the its still in the Image Control?? thats the strangest part. I think if someone would suggest a solution here, it would work.
Allonii
|
|
|
|
|
You are reading the picture into memory when you set the image source equal to the file. If the program is going to display the image, it MUST read the image into memory at some point and WILL keep it in memory for at least the duration of the time it is being shown.
|
|
|
|
|
yes, I'm aware of that but its then referring to the file and by that reduce the memory usage.
I tried to write 10 pictures to the hard drive and read from them and compered the same application but instead reading from a memory stream. Well the app reading from the files used 30-50 % less memory.
That's why I don't see anything positive with reading pictures directly from a memory stream
|
|
|
|
|
Im new in the WPF issues.
I create some WPF object - this object is some square that need to be in some size.
In run time i need to pass somehow the size of the square and i dont know how to do it.
thanks for any help.
|
|
|
|
|
Please post your XAML code
|
|
|
|
|
Yanshof wrote: I create some WPF object - this object is some square
It would really make it easier to help if you specify the class of the "some WPF object".
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
SomeWpfObject , it implements ISomeWpfObject .
|
|
|
|
|
I need to read the docs more closely
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
if your squar is any UIElement or a rectangle try this
Rectangle myrect = new Rectangle;
myrect.width = 10;
myrect.height = 10;
myrect.Margin = new Thickness(100,100,0,0);
|
|
|
|
|
if I created a silverlight menu using expression blend, what do I need to do exactly in order to add to my asp.net 2.0 web application?
I know that silverlight needs framerwork 3.0 or 3.5. But my web applcation is built on framework 2.0 so how can I convert it so that I could use the silverlight control?
I need steps please..
thanks in advance
|
|
|
|
|
|
I have a problem with ValidationRules. Basically the data binding works, but the Validate-method of the ValidationRules never fire.
This is part of my XAML (ZoomDialogBox.xaml):
<StackPanel Grid.Column="0" Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
<Label>Factor:</Label>
<TextBox Name="FactorTextBox" Width="30" Margin="10,0,0,0">
<TextBox.Text>
<Binding Path="." UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<validators:ZoomFactorValidationRule MinZoomFactor="1" MaxZoomFactor="20" />
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
</StackPanel>
This is the property I am binding to, and this binding works (from ZoomDialogBox.cs):
public int ZoomFactor
{
get
{
return (int) this.DataContext;
}
set
{
this.DataContext = value;
}
}
As said, the binding works, but the ValidationRules is never applied. What am I doing wrong here?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
|
I did try that earlier (and now again), and the result is the same. Validate() never fires!
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
Your ZoomFactor property should be turned into a property with a backing field.
There are many different ways for the TextBox to bind to the ZoomFactor property.
One way is in the constructor of the ZoomDialogBox.cs file, use this line of code
this.DataContext = this;
Then change the Path in the TextBox to ZoomFactor.
You should also look at the VS Output window to see any data binding errors when your application is running.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Yes, yes yes! Thank you. Now it works.
And thanks for the tip on the Output window, I did not know that databinding errors was shown there. That can be a great time-saver.
Once again, thanks for the help.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
Glad you're up and running. Have a great day!
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi I have developed an ASP.Net application which uses silverlight.
This application works fine on my local PC.But when I uploaded it on the web server,it throws an exception saying
Silverlight error code: 2104 error type : InitializeError.
I have added the required(.xap application/x-silverlight-app,.xaml application/xaml+xml, .xbap application/x-ms-xbap ) MIME types to the IIS.
Still it is showing the same error.
Can anyone tell me how can I configure the webserver to support silverlight?
Thanks and regards
ARINDAM
|
|
|
|
|
I think the server doesn't support SilverLight.
Are u sure about it.
|
|
|
|
|
You can google how to configure MIME type for Silverlight. Let me know if you are still having this problem..
|
|
|
|
|
Hi!
I encounterd something weird!
Using the .net memory profiler, if i have a wpf button and hoover it, the number of undisposed instances increases dramatically.
Anyone here having the same problem?
Is it a problem or is it an error of the memory profiler?
BTW, neither the GC disposes these instances.
|
|
|
|
|
Can you post your XAML here. Just want to see exactly what you are doing.
Also, what version of Visual Studio are you using?
Any .NET services packs applied?
Which memory profiler?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Simple XAML:
<Window x:Class="ButtonTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:command="clr-namespace:ButtonTest"
Title="Window1" Height="300" Width="300">
<Window.CommandBindings>
<CommandBinding
Command="{x:Static command:Stetics.uiCommand}"
Executed="CommandBinding_Executed"
CanExecute="CommandBinding_CanExecute"/>
</Window.CommandBindings>
<Grid>
<Button Height="50" Width="100" Command="{x:Static command:Stetics.uiCommand}"></Button>
</Grid>
</Window>
Code Behind:
namespace ButtonTest
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void CommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
{
}
private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = true;
}
}
}
Software installed:
VS 2008 TS + SP1 (.NET 3.5 + Sp1)
.NET Memory Profiler 3.1 (http://memprofiler.com/[^]
Coderush EXPRESS 3.2
GhostDOC
Action:
Enter and Leave the Button.
Undisposed items after 60 sec. : 2.191 -> this number can get real high after a few minutes
Hope that helps.
|
|
|
|
|
This is just what we need to repro.
Can you also post the Command Code.
This way we are using the exact code you are.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Nothing special in here either:
using System.Windows.Input;
namespace ButtonTest
{
public static class Stetics
{
public static RoutedUICommand uiCommand = new RoutedUICommand();
}
}
|
|
|
|