Click here to Skip to main content
15,792,482 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to pass a new instance of a viewmodel to an existing usercontrol? Pin
Mycroft Holmes31-May-11 14:14
professionalMycroft Holmes31-May-11 14:14 
GeneralRe: How to pass a new instance of a viewmodel to an existing usercontrol? Pin
_Maxxx_31-May-11 14:27
professional_Maxxx_31-May-11 14:27 
GeneralRe: How to pass a new instance of a viewmodel to an existing usercontrol? Pin
Mycroft Holmes31-May-11 15:30
professionalMycroft Holmes31-May-11 15:30 
GeneralRe: How to pass a new instance of a viewmodel to an existing usercontrol? Pin
_Maxxx_31-May-11 16:59
professional_Maxxx_31-May-11 16:59 
QuestionHow to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Vimalsoft(Pty) Ltd26-May-11 1:18
professionalVimalsoft(Pty) Ltd26-May-11 1:18 
QuestionRe: How to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Mark Salsbery26-May-11 12:10
Mark Salsbery26-May-11 12:10 
AnswerRe: How to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Vimalsoft(Pty) Ltd26-May-11 12:13
professionalVimalsoft(Pty) Ltd26-May-11 12:13 
GeneralRe: How to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Mark Salsbery26-May-11 12:39
Mark Salsbery26-May-11 12:39 
It should work with valid JPEG bytes...

I tested your LoadImage() method but with JPEG bytes loaded from disk and it works fine:

private void loadButton_Click(object sender, RoutedEventArgs e)
{
    OpenFileDialog ofdlg = new OpenFileDialog();
    ofdlg.Filter = "Image Files (*.jpg, *.jpeg, *.png)|*.jpg;*.jpeg;*.png";
    if (true == ofdlg.ShowDialog())
    {
        long filelength = ofdlg.File.Length;
        Byte[] imageBytes = new byte[filelength];
        using (FileStream fs = ofdlg.File.OpenRead())
        {
            fs.Read(imageBytes, 0, (int)filelength);
        }
        PhotoHolder.Source = GenericMethods.LoadImage(imageBytes);
    }
}

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Vimalsoft(Pty) Ltd26-May-11 20:04
professionalVimalsoft(Pty) Ltd26-May-11 20:04 
GeneralRe: How to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Mark Salsbery26-May-11 20:09
Mark Salsbery26-May-11 20:09 
QuestionHow to retrieve hyperlink url from selection text in wpf? Pin
John-ph26-May-11 0:06
John-ph26-May-11 0:06 
QuestionInstaller for WPF Control Pin
Prasoon Chaudhary25-May-11 22:22
Prasoon Chaudhary25-May-11 22:22 
AnswerRe: Installer for WPF Control Pin
Wayne Gaylard25-May-11 22:32
professionalWayne Gaylard25-May-11 22:32 
QuestionRe: Installer for WPF Control Pin
Prasoon Chaudhary25-May-11 23:09
Prasoon Chaudhary25-May-11 23:09 
AnswerRe: Installer for WPF Control Pin
Abhinav S26-May-11 8:55
Abhinav S26-May-11 8:55 
QuestionHow to Access a Cookie Created in Silverlight from an Asp.net page Pin
Vimalsoft(Pty) Ltd25-May-11 6:29
professionalVimalsoft(Pty) Ltd25-May-11 6:29 
AnswerRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Pete O'Hanlon25-May-11 7:25
subeditorPete O'Hanlon25-May-11 7:25 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Vimalsoft(Pty) Ltd25-May-11 8:18
professionalVimalsoft(Pty) Ltd25-May-11 8:18 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Pete O'Hanlon25-May-11 10:06
subeditorPete O'Hanlon25-May-11 10:06 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Mycroft Holmes25-May-11 13:03
professionalMycroft Holmes25-May-11 13:03 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Vimalsoft(Pty) Ltd6-Jun-11 5:55
professionalVimalsoft(Pty) Ltd6-Jun-11 5:55 
QuestionSilverlight and subdomains Pin
Mycroft Holmes24-May-11 23:44
professionalMycroft Holmes24-May-11 23:44 
AnswerRe: Silverlight and subdomains Pin
Mark Salsbery25-May-11 0:15
Mark Salsbery25-May-11 0:15 
GeneralRe: Silverlight and subdomains Pin
Mycroft Holmes25-May-11 0:25
professionalMycroft Holmes25-May-11 0:25 
GeneralRe: Silverlight and subdomains Pin
Mark Salsbery25-May-11 0:30
Mark Salsbery25-May-11 0:30 

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.