martynball
Member
- Joined
- Jul 8, 2014
- Messages
- 14
- Programming Experience
- Beginner
Hey, new to C#, going try to teach myself as I go. Now i'm trying to load an image into memory, all i'm getting on Google is:
Along them lines, obviously gotta define it as an Image object and then load the data into it, but Visual Studio is saying that the first word needs arguments.
Give me a hand here guys?
Code:
Errors:
C#:
Image myimg = Image.FromFile("image location");
Along them lines, obviously gotta define it as an Image object and then load the data into it, but Visual Studio is saying that the first word needs arguments.
Give me a hand here guys?
Code:
C#:
Public Class Form1
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Image myimg = Image.FromFile("C:\Users\Martyn Ball\Desktop\10502092_657871814300163_3690168410002388536_n.jpg");
End Sub
End Class
Errors:
C#:
Error 1 'Image' is a type and cannot be used as an expression. c:\users\martyn ball\documents\visual studio 2013\Projects\JamSnaps\JamSnaps\Form1.vb 4 9 JamSnaps
Error 2 Method arguments must be enclosed in parentheses. c:\users\martyn ball\documents\visual studio 2013\Projects\JamSnaps\JamSnaps\Form1.vb 4 15 JamSnaps
Error 3 'myimg' is not declared. It may be inaccessible due to its protection level. c:\users\martyn ball\documents\visual studio 2013\Projects\JamSnaps\JamSnaps\Form1.vb 4 15 JamSnaps
Error 4 Character is not valid. c:\users\martyn ball\documents\visual studio 2013\Projects\JamSnaps\JamSnaps\Form1.vb 4 120 JamSnaps
Last edited: