Click here to Skip to main content
15,916,941 members
Home / Discussions / C#
   

C#

 
GeneralRe: UDP communication and CRC16 calculations Pin
MaWeRic20-May-16 0:12
MaWeRic20-May-16 0:12 
GeneralRe: UDP communication and CRC16 calculations Pin
harold aptroot20-May-16 1:05
harold aptroot20-May-16 1:05 
QuestionEnableRaisingEvents automatically sets to false Pin
IT - Researcher19-May-16 21:58
IT - Researcher19-May-16 21:58 
QuestionMigrating C# desktop application to Windows 10 Pin
UnlockSecrets4WeightLoss19-May-16 19:19
UnlockSecrets4WeightLoss19-May-16 19:19 
AnswerRe: Migrating C# desktop application to Windows 10 Pin
Richard MacCutchan19-May-16 21:25
mveRichard MacCutchan19-May-16 21:25 
AnswerRe: Migrating C# desktop application to Windows 10 Pin
Richard Deeming20-May-16 1:47
mveRichard Deeming20-May-16 1:47 
QuestionBuild navigation with routed URL in ASP.NET MVC Pin
Member 1204569219-May-16 19:16
Member 1204569219-May-16 19:16 
AnswerRe: Build navigation with routed URL in ASP.NET MVC Pin
Richard MacCutchan19-May-16 21:24
mveRichard MacCutchan19-May-16 21:24 
QuestionASP.NET MVC. Specific URL for partial views Pin
Member 1204569219-May-16 14:02
Member 1204569219-May-16 14:02 
AnswerRe: ASP.NET MVC. Specific URL for partial views Pin
Richard MacCutchan19-May-16 21:23
mveRichard MacCutchan19-May-16 21:23 
QuestionHow can I download a picture in powershell and display it in C#? Pin
turbosupramk319-May-16 10:34
turbosupramk319-May-16 10:34 
AnswerRe: How can I download a picture in powershell and display it in C#? Pin
Richard MacCutchan19-May-16 21:22
mveRichard MacCutchan19-May-16 21:22 
GeneralRe: How can I download a picture in powershell and display it in C#? Pin
turbosupramk324-May-16 9:11
turbosupramk324-May-16 9:11 
QuestionRe: How can I download a picture in powershell and display it in C#? Pin
Richard MacCutchan24-May-16 9:23
mveRichard MacCutchan24-May-16 9:23 
AnswerRe: How can I download a picture in powershell and display it in C#? Pin
turbosupramk324-May-16 10:46
turbosupramk324-May-16 10:46 
GeneralRe: How can I download a picture in powershell and display it in C#? Pin
turbosupramk324-May-16 12:04
turbosupramk324-May-16 12:04 
I figured it out, I had to build my own byte array and not use memory stream. Memory stream was corrupting the file and making it an additional 28 bytes. I'm not sure why this wasn't on the internet, as it seems 100's of people encounter this?

Thanks for pointing me in the right direction.


C#
byte[] imgBytes = null;
            List<byte> imgBytesList = new List<byte>();
            object imgObj = null;
            Image img = null;
            foreach (PSObject obj in exResults)
            {
                imgObj = obj.Properties["PictureData"].Value;
            }


            
            foreach (byte byt in (dynamic)imgObj)
            {
                imgBytesList.Add(byt);
                
            }

            imgBytes = imgBytesList.ToArray();




            using (var ms = new MemoryStream(imgBytes))
            {
                img = Image.FromStream(ms);
                
            }

            pbxDisplayPicture.Image = img;

QuestionIDisposable with COM Pin
hpjchobbes19-May-16 5:13
hpjchobbes19-May-16 5:13 
AnswerRe: IDisposable with COM Pin
Gerry Schmitz19-May-16 5:35
mveGerry Schmitz19-May-16 5:35 
AnswerRe: IDisposable with COM Pin
Dave Kreskowiak19-May-16 5:36
mveDave Kreskowiak19-May-16 5:36 
GeneralRe: IDisposable with COM Pin
OriginalGriff19-May-16 6:16
mveOriginalGriff19-May-16 6:16 
GeneralRe: IDisposable with COM Pin
hpjchobbes19-May-16 7:19
hpjchobbes19-May-16 7:19 
GeneralRe: IDisposable with COM Pin
Dave Kreskowiak19-May-16 7:23
mveDave Kreskowiak19-May-16 7:23 
QuestionEnumResourceLanguages return false for resource type identified by Name Pin
noelblanc18-May-16 10:14
noelblanc18-May-16 10:14 
AnswerRe: EnumResourceLanguages return false for resource type identified by Name Pin
noelblanc18-May-16 22:15
noelblanc18-May-16 22:15 
QuestionDraw 2 lines in a picture box and automatically measure the angle between the line Pin
Shithun NK18-May-16 6:23
Shithun NK18-May-16 6:23 

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.