Click here to Skip to main content
15,881,898 members
Home / Discussions / C#
   

C#

 
GeneralRe: Unity connection with a smartwatch and getting heart rate data Pin
Gerry Schmitz1-Dec-20 18:23
mveGerry Schmitz1-Dec-20 18:23 
QuestionDifferences Pin
michaelbarb30-Nov-20 5:53
michaelbarb30-Nov-20 5:53 
AnswerRe: Differences Pin
OriginalGriff30-Nov-20 6:20
mveOriginalGriff30-Nov-20 6:20 
GeneralRe: Differences Pin
michaelbarb30-Nov-20 6:39
michaelbarb30-Nov-20 6:39 
QuestionIs my program idea possible? Pin
Dioxazine27-Nov-20 20:09
Dioxazine27-Nov-20 20:09 
AnswerRe: Is my program idea possible? Pin
OriginalGriff27-Nov-20 20:20
mveOriginalGriff27-Nov-20 20:20 
GeneralRe: Is my program idea possible? Pin
Dioxazine28-Nov-20 5:54
Dioxazine28-Nov-20 5:54 
GeneralRe: Is my program idea possible? Pin
OriginalGriff28-Nov-20 6:17
mveOriginalGriff28-Nov-20 6:17 
Oh come on! Are you trying to run before you can walk? This is pretty basic stuff!

You know what a byte[] is, don't you? It's an array of bytes, is all. So what do you think that File.ReadAllBytes does? And if you don't understand what a function does, look it up in the official documentation: File.ReadAllBytes(String) Method (System.IO) | Microsoft Docs[^]

The next two are there for a specific reason: while you can load an image directly from a file, that locks the file until the image is Disposed - so if you want to write a modified version back to the file in your app, you can't. Converting the data to a Stream gets round that, by locking the Stream instead of the file. And if you don't understand what a Stream is then how on earth are you doing any file input / output? Laugh | :laugh:

So those three lines do this:
1) Read the disk-based image file into an array of bytes.
2) Construct a memory-based Stream from the array.
3) Create an Image from the Stream.

Seriously, if you don't understand stuff like this, then you need to re-read your course notes from the beginning, because you have missed a heck of a lot of useful stuff!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Is my program idea possible? Pin
Dioxazine28-Nov-20 8:09
Dioxazine28-Nov-20 8:09 
GeneralRe: Is my program idea possible? Pin
OriginalGriff28-Nov-20 8:22
mveOriginalGriff28-Nov-20 8:22 
GeneralRe: Is my program idea possible? Pin
Liktor Janos11-Dec-20 7:42
Liktor Janos11-Dec-20 7:42 
GeneralRe: Is my program idea possible? Pin
Gerry Schmitz28-Nov-20 7:51
mveGerry Schmitz28-Nov-20 7:51 
QuestionError in SQL Light Compact 4 Pin
Alex Dunlop23-Nov-20 3:47
Alex Dunlop23-Nov-20 3:47 
AnswerRe: Error in SQL Light Compact 4 Pin
Victor Nijegorodov23-Nov-20 3:56
Victor Nijegorodov23-Nov-20 3:56 
GeneralRe: Error in SQL Light Compact 4 Pin
Alex Dunlop23-Nov-20 4:04
Alex Dunlop23-Nov-20 4:04 
GeneralRe: Error in SQL Light Compact 4 Pin
Richard Deeming23-Nov-20 4:18
mveRichard Deeming23-Nov-20 4:18 
GeneralRe: Error in SQL Light Compact 4 Pin
OriginalGriff23-Nov-20 4:29
mveOriginalGriff23-Nov-20 4:29 
GeneralRe: Error in SQL Light Compact 4 Pin
Alex Dunlop23-Nov-20 7:38
Alex Dunlop23-Nov-20 7:38 
GeneralRe: Error in SQL Light Compact 4 Pin
OriginalGriff23-Nov-20 7:53
mveOriginalGriff23-Nov-20 7:53 
GeneralRe: Error in SQL Light Compact 4 Pin
Alex Dunlop23-Nov-20 8:10
Alex Dunlop23-Nov-20 8:10 
GeneralRe: Error in SQL Light Compact 4 Pin
OriginalGriff23-Nov-20 8:19
mveOriginalGriff23-Nov-20 8:19 
GeneralRe: Error in SQL Light Compact 4 Pin
Alex Dunlop23-Nov-20 8:28
Alex Dunlop23-Nov-20 8:28 
GeneralRe: Error in SQL Light Compact 4 Pin
Richard Deeming23-Nov-20 17:43
mveRichard Deeming23-Nov-20 17:43 
GeneralRe: Error in SQL Light Compact 4 Pin
Alex Dunlop24-Nov-20 6:06
Alex Dunlop24-Nov-20 6:06 
GeneralRe: Error in SQL Light Compact 4 Pin
Dave Kreskowiak24-Nov-20 8:52
mveDave Kreskowiak24-Nov-20 8:52 

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.