Hi!
I'm creating new project and want to use drawing and graphics to edit pictures...
I tried to import system library:
Imports System.Drawing.Drawing2D
and created object:
Dim G As Graphics = picture.CreateGraphics
I created simple utility to test writting one line:
Private Sub MainLine()
X = Int(picture.Width)
Y = Int(picture.Height)
mLinePos = X / 2
Dim P As Pen = New Pen(Color.Red)
G.DrawLine(P, mLinePos, 0, mLinePos, Y)
curX = X / baseX
curY = Y / baseY
G.ScaleTransform(curX, curY)
End Sub
Then Visual Basic reported error... and after removing code which was to test and object declaration and import too, project always reports the same error, look below...
Can anybody help me?
Many many thanks for everything!
System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an
instance of an object."
Source="The Body Analyzer"
StackTrace:
at The_Body_Analyzer.My.MyProject.MyForms.Create__Ins tance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at The_Body_Analyzer.My.MyProject.MyForms.get_Form1()
at The_Body_Analyzer.My.MyApplication.OnCreateMainFor m() in C:\Documents\Visual Studio 2008\Projects\The Body Analyzer\The Body
Analyzer\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine)
at The_Body_Analyzer.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.NullReferenceException
Message="Object reference not set to an instance of an object."
Source="The Body Analyzer"
StackTrace:
at The_Body_Analyzer.Form1..ctor() in C:\Documents\Visual Studio 2008\Projects\The Body Analyzer\The Body Analyzer\Form1.vb:line
4
InnerException:
I'm creating new project and want to use drawing and graphics to edit pictures...
I tried to import system library:
Imports System.Drawing.Drawing2D
and created object:
Dim G As Graphics = picture.CreateGraphics
I created simple utility to test writting one line:
Private Sub MainLine()
X = Int(picture.Width)
Y = Int(picture.Height)
mLinePos = X / 2
Dim P As Pen = New Pen(Color.Red)
G.DrawLine(P, mLinePos, 0, mLinePos, Y)
curX = X / baseX
curY = Y / baseY
G.ScaleTransform(curX, curY)
End Sub
Then Visual Basic reported error... and after removing code which was to test and object declaration and import too, project always reports the same error, look below...
Can anybody help me?
Many many thanks for everything!
System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an
instance of an object."
Source="The Body Analyzer"
StackTrace:
at The_Body_Analyzer.My.MyProject.MyForms.Create__Ins tance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at The_Body_Analyzer.My.MyProject.MyForms.get_Form1()
at The_Body_Analyzer.My.MyApplication.OnCreateMainFor m() in C:\Documents\Visual Studio 2008\Projects\The Body Analyzer\The Body
Analyzer\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine)
at The_Body_Analyzer.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.NullReferenceException
Message="Object reference not set to an instance of an object."
Source="The Body Analyzer"
StackTrace:
at The_Body_Analyzer.Form1..ctor() in C:\Documents\Visual Studio 2008\Projects\The Body Analyzer\The Body Analyzer\Form1.vb:line
4
InnerException: