Click here to Skip to main content
15,887,240 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Compatible with VS 2005 Pin
Mohammad Dayyan8-Jan-09 10:45
Mohammad Dayyan8-Jan-09 10:45 
AnswerRe: Compatible with VS 2005 Pin
CrazyCoder269-Jan-09 20:32
CrazyCoder269-Jan-09 20:32 
QuestionFocusing problem ? Pin
Mohammad Dayyan4-Jan-09 3:26
Mohammad Dayyan4-Jan-09 3:26 
AnswerRe: Focusing problem ? Pin
Mark Salsbery4-Jan-09 6:30
Mark Salsbery4-Jan-09 6:30 
GeneralRe: Focusing problem ? Pin
Mohammad Dayyan4-Jan-09 6:52
Mohammad Dayyan4-Jan-09 6:52 
GeneralRe: Focusing problem ? Pin
Mark Salsbery4-Jan-09 9:32
Mark Salsbery4-Jan-09 9:32 
GeneralRe: Focusing problem ? Pin
Mohammad Dayyan4-Jan-09 21:44
Mohammad Dayyan4-Jan-09 21:44 
QuestionWPF save button Pin
siten03083-Jan-09 12:23
siten03083-Jan-09 12:23 
Hello,

I have two questions, the first is, I have a button that says "crop image" and I want it to change to "cancel" when the user clicks on "crop image" and vis versa, how can this be done, its easy in C# but WPF.... ??

second, the save dialog, its a little different than opendialog, i heard not much, the problem is, I have the code below, I want to save the image object which is the second object from my form, i have 2 image objects, one is the primary, the second is the crop image, I want to save the crop image, which we we call this object cropimage. anyways i want to save it but for some reason, i know I am missing something, again I have the code below, it will not save the crop image to a file extension jpg or bmp, what am i missing, here is the code below, thanks in advance:


private void _btnSave_Click(object sender, RoutedEventArgs e)
{
try
{
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
dlg.FileName = "Image1"; // Default file name
dlg.DefaultExt = ".jpg"; // Default file extensions
dlg.DefaultExt = ".bmp"; // Default file extensions
dlg.Filter = "Picture File (*.jpg)|*.jpg|*.bmp)|*.bmp"; // Filter files by extension

// Show save file dialog box
Nullable<bool> result = dlg.ShowDialog();

// Process save file dialog box results
if (result == true)
{
string selectedFileName = dlg.FileName;
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.UriSource = new Uri(selectedFileName);
bitmap.EndInit();
_imageCrop.Source = bitmap;

}
}
catch (Exception)
{
System.Windows.MessageBox.Show("Please save it to the appropriate file type.");
}
Cry | :((
AnswerRe: WPF save button Pin
Mark Salsbery3-Jan-09 15:09
Mark Salsbery3-Jan-09 15:09 
GeneralRe: WPF save button Pin
siten03083-Jan-09 18:42
siten03083-Jan-09 18:42 
GeneralRe: WPF save button Pin
Mark Salsbery3-Jan-09 20:58
Mark Salsbery3-Jan-09 20:58 
GeneralRe: WPF save button Pin
siten03084-Jan-09 5:56
siten03084-Jan-09 5:56 
GeneralRe: WPF save button Pin
Mark Salsbery4-Jan-09 6:21
Mark Salsbery4-Jan-09 6:21 
Questionback ground color change inGrid Pin
member272-Jan-09 20:13
member272-Jan-09 20:13 
Questionsilverlight Pin
vkvimal2-Jan-09 18:51
vkvimal2-Jan-09 18:51 
AnswerRe: silverlight Pin
Timmy Kokke5-Jan-09 1:27
Timmy Kokke5-Jan-09 1:27 
AnswerRe: silverlight Pin
Mohammad Dayyan8-Jan-09 10:51
Mohammad Dayyan8-Jan-09 10:51 
GeneralRe: silverlight Pin
vkvimal10-Jan-09 19:05
vkvimal10-Jan-09 19:05 
GeneralRe: silverlight Pin
Mohammad Dayyan10-Jan-09 23:36
Mohammad Dayyan10-Jan-09 23:36 
GeneralRe: silverlight Pin
vkvimal23-Jan-09 18:55
vkvimal23-Jan-09 18:55 
Questionrotate an arrow using silverlight Pin
priyagee2-Jan-09 1:13
priyagee2-Jan-09 1:13 
AnswerRe: rotate an arrow using silverlight Pin
Michael Sync29-Jan-09 2:42
Michael Sync29-Jan-09 2:42 
QuestionTo Create Button Template Storyboard Pin
Member 58061221-Jan-09 18:29
Member 58061221-Jan-09 18:29 
AnswerRe: To Create Button Template Storyboard Pin
Lev Danielyan5-Jan-09 20:57
Lev Danielyan5-Jan-09 20:57 
QuestionPlay QuickTime video file Using WPF Pin
Khan Firoz30-Dec-08 4:12
Khan Firoz30-Dec-08 4:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.