Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18011
Number of posts: 55384

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Visual Basic.NET drawing and graphics problem Posted by MIRKOSOFT on 10 Nov 2012 at 2:59 AM
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__Instance__[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.OnCreateMainForm() in C:\Documents\Visual Studio 2008\Projects\The Body Analyzer\The Body

Analyzer\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.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.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext 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:





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.