Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2219
  • Last Modified:

Plotting a line in VB.NET on a Picturebox image

i am plotting a line in VB.NET on a Picturebox image (which is a white image with some black lines). The problem is i need to know if my line passes through some line (obstacle) in the image. So at each pixel while drawing the line i will have to check the pixel at each point and whether the pixel is of the colour of the obstacle or not. how can i achieve this?
Any help will be appreciated
Regards
Hitesh
0
hiteshgoldeneye
Asked:
hiteshgoldeneye
  • 3
  • 3
1 Solution
 
Bob LearnedCommented:
What other kind of "obstacles" are you talking about?  How are you drawing these?  Are you keeping track of them?

Bob
0
 
hiteshgoldeneyeAuthor Commented:
The obstacles are already present on the Picturebox image, i do not keep track of them.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Create a Bitmap from your PictureBox Image and use the GetPixel() method:
http://msdn2.microsoft.com/en-us/library/system.drawing.bitmap.getpixel.aspx

Something like...

    Dim bmp As New Bitmap(PictureBox1.Image)
    If bmp.GetPixel(x,y).Equals(Color.Black) Then
       ...
    End If
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
Bob LearnedCommented:
Hello, Shadow :D

Bob
0
 
hiteshgoldeneyeAuthor Commented:
Hi i missed an important second point of my question, if the line i want to plot to connect two points meets an obstacle i want to deviate and draw another line not neccessarily linear or curve so that i can connect the two points without passing through an obstacle. Any idea on this.
0
 
Bob LearnedCommented:
It sounds like you are doing something like flowcharting.

Bob
0
 
hiteshgoldeneyeAuthor Commented:
you can say so or you can even say its something similar to a game :) but i hope my objective is clear, any solution to it or helpful tips?
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now