|
You can't convert a PDF into an image simply by converting it into a byte array. Without the conversion to an image, the BitmapImage identifies that it cannot display the byte array, so it doesn't attempt to display it. You might want to try this[^] library for the actual conversion (there's even a small sample on saving a PDF to a png file).
|
|
|
|
|
Hi Pete,
I have tried this. But i am unable to add the dll in my Silverlight Application.
Gomathi R
|
|
|
|
|
You don't add it to the Silverlight side - you add it to the ASP.NET side, and send the byte array to the Silverlight app. That is, after all, where you are getting the PDF from isn't it?
|
|
|
|
|
Even in asp .net i am unable to add the dlls. I have added libpdf dll and tried to run the code. I got the following error. Could not load file or assembly 'libpdf.DLL' or one of its dependencies. The specified module could not be found.
Gomathi R
|
|
|
|
|
I am trying to create a basic Silverlight application that user can access via IE. The SL application will read some local registry settings (e.g. OS installed, ). Any direction/example will be greatly appreciated.
|
|
|
|
|
picasso2 wrote: Any direction/example will be greatly appreciated. Start here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi all,
I want to set theme dynamically in my silverlight application.
How can i do this??
|
|
|
|
|
Luckily for you, someone wrote an article on how to do this here[^].
|
|
|
|
|
|
Intriguing. That's exactly the same article I linked to in the message just above this one. What, precisely, are you adding to the sum total of knowledge gained from this thread?
|
|
|
|
|
What is the point of repeating the exact same thing as Pete did. Don't you read other peoples answers before you answer, or are you just trying to gain reputation points ?
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
I have a version of Telerik and i used Scheduler view, when I change value of flow direction ,right to left , of my windows, and when I drag a inserted appointment, it does `t normally drag ,
What can I do for fix the problem?
Thanks a lot
|
|
|
|
|
Raise this with Telerik. It could well be a bug.
|
|
|
|
|
|
I change my Telerik version from 2.0 to 4.0,,, and solve it....
Is so nice!!
|
|
|
|
|
hello
My program has a ListView, which is connected to an ObservableCollection.
If I add values to the ObservableCollection, I can see them in the ListView.
But if I change an object in the ObservableCollection, the change is not seen in the ListView. The modification is made by changing the name in the textbox side and clicking the "CAMBIA"
<Window x:Class="WpfApplication3.bindingListBoxTOstring"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="bindingListV" Height="300" Width="300"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
>
<Grid>
<ListView Name="lv" ItemsSource="{Binding ListBoxCollection, UpdateSourceTrigger=PropertyChanged}" Margin="12,0,128,50" SelectionChanged="lv_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn Header="profilo" Width="200"
DisplayMemberBinding="{Binding nome, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</GridView>
</ListView.View>
</ListView>
<Label Content="Cambia valore" Height="28" HorizontalAlignment="Left" Margin="164,23,0,0" Name="label1" VerticalAlignment="Top" Width="102" />
<TextBox Height="32" HorizontalAlignment="Left" Margin="154,56,0,0" Name="textBox1" VerticalAlignment="Top" Width="114" />
<Button Content="cambia" Height="23" HorizontalAlignment="Left" Margin="177,107,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
</Grid>
</Window>
namespace WpfApplication3
{
public partial class bindingListBoxTOstring : Window
{
ObservableCollection<ListBoxData> _ListBoxCollection =
new ObservableCollection<ListBoxData>();
public bindingListBoxTOstring()
{
InitializeComponent();
_ListBoxCollection.Add(new ListBoxData { nome = "netgear" });
_ListBoxCollection.Add(new ListBoxData { nome = "alice13" });
}
public ObservableCollection<ListBoxData> ListBoxCollection
{ get { return _ListBoxCollection; } }
public class ListBoxData
{
public string nome { get; set; }
}
private void button1_Click(object sender, RoutedEventArgs e)
{
ListBoxData x = lv.SelectedItem as ListBoxData;
x.nome = (textBox1.Text) != string.Empty ? (textBox1.Text) : string.Empty ;
}
private void lv_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ListBoxData x = lv.SelectedItem as ListBoxData;
textBox1.Text = x.nome;
}
}
}
|
|
|
|
|
The item you are editing has to notify WPF that it has changed. Just because you have an ObservableCollection , it doesn't mean that your application will be able to respond to changed inside the items that make up the collection. To enable this, you need so expose those items to the binding mechanism as well - fortunately, this is incredibly easy to do.
Change your ListBoxData class so that it (or an ancestor that you choose) implements INotifyPropertyChanged . Then, add the ability to raise a change when nome changes. For example:
public class ListBoxData : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private string _nome;
public string nome
{
get { return _nome; }
set
{
if (_nome != value)
{
_nome = value;
OnChanged("nome");
}
}
}
private void OnChanged(string propertyName)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
} Now, whenever you change nome, the PropertyChanged event is raised - and the WPF binding mechanism knows how to handle that. Changes will be reflected in the UI now.
|
|
|
|
|
thanks!!! thanks!!! thanks!!! thanks!!!
I was in danger situation for this problem since two day
|
|
|
|
|
I am trying to create a user control in a WPF application that includes a BitmapImage that has been added to the project by including it in Resources.resx. In the xaml editor using VS 2012 I can put the cursor inside the BitmapImage tag, and then reference the properties of the BitmapImage from the editor's properties pane.
In the UriSource dropdown box I can see all of the resources that I have added to the application including those images that are included in Resources.resx, but when I add one of the images and run the program, an exception is raised referencing the line in the xaml where the BitmapImage control is defined.
For example if I start with this:
<BitmapImage x:Key="CameraImage" CreateOptions="IgnoreImageCache" CacheOption="OnLoad" />
And use properties pane to select the image I want from the UriSource field, this attribute is added:
UriSource="pack://siteoforigin:,,,/Resources/Camera32x32.png"
From what I can tell this URI references a file that should be on the drive in the "Resources" directory below the point from which the application runs. If so, I understand why this would produce an error, since that directory does not exist where the application runs (and is not supposed to).
From the documentation I have seen, if a resource is embedded in the local assembly (i.e., the exe file), that the right URI should be something like this:
UriSource="pack://application:,,,/Resources/Camera32x32.png"
where "siteoforigin " is replaced with "application ." But that does not seem to work for me either.
The exceptions I see differ depending on different modifications I've made to this attribute's value. The last one referenced gives me a XamlParseException with a message saying, "'Initialization of 'System.Windows.Media.Imaging.BitmapImage' threw an exception," and it had an inner IOException with a message of "Cannot locate resource 'resources/camera32x32.png'." The siteoforigin syntax also throws a XamlParseException , but the inner exception is a DirectoryNotFoundException , and says "Could not find a part of the path."
I have tried several things without luck here, and I've run out of ideas. Can someone help to point me down the right path, and tell me how I can reference an embedded resource from a xaml page?
Gil Yoder
Houston, TX
|
|
|
|
|
I lucked upon an answer to my own question with more research. Having the image in the Resources.resx file was not sufficient to reference the resource with the pack URI. I needed to set the properties of the file to be a resource, or configured to copy to the output directory. I had neither.
By setting the files to "resource" I was able to get the URI to work even after remove all of the files from the RESX file.
[url=http://www.forum-signatures.com][img]http://www.forum-signatures.com/wizard/Sigs/2010/final132825116615.png[/img][/url]
|
|
|
|
|
Good Morning to for all,
please send the silver light all topics with partical marials.
|
|
|
|
|
I'm sorry, but I don't understand. What are partical marials? I appreciate that English isn't your first language, so perhaps if you could link to a Wikipedia page or something like that, I might understand what you are talking about.
|
|
|
|
|
|
|
I'm trying to check to see if a WCF service is running, and if not, exit. So far I have this:
bool serviceRunning = true;
try
{
Proxy = new MyAppServiceRef.MyAppServiceClient();
}
catch (Exception e)
{
serviceRunning = false;
}
try
{
serviceRunning = !Proxy.ServiceRunning();
}
catch (Exception e)
{
serviceRunning = false;
}
if (!serviceRunning)
{
string message = "The service appears to not be running. Please check the service. " + ApplicationTitle + " will now exit.";
MessageBox.Show(message, "Service Error", MessageBoxButton.OK, MessageBoxImage.Stop);
Application.Current.Shutdown();
}
1) is this really the way to do this?
2) After the call to Application.Current.Shutdown() the app continue to run and I get XAML errors. How to I actually stop the app dead right here?
Thanks
If it's not broken, fix it until it is
|
|
|
|