Pixel positions in image
Pixel positions in image
Pixel positions in image
Pixel positions in image
Pixel positions in image
Pixel positions in image Pixel positions in image Pixel positions in image Pixel positions in image Pixel positions in image Pixel positions in image Pixel positions in image Pixel positions in image
Pixel positions in image Pixel positions in image
Pixel positions in image
Go Back  Xtreme Visual Basic Talk > > > Pixel positions in image


Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2013, 03:38 AM
Magistro Magistro is offline
Newcomer
 
Join Date: Sep 2013
Posts: 1
Default Pixel positions in image


Hi,

First of all i wanna thank the people replying in the entire forum. Your forum has helped me a lot of times, when i needed a simple piece of coding. But now i need a piece of coding that isn't on this forum already (or i couldn't find it). So i registered in the hope someone could help me.

This is the situation.

I'm looking for a piece of code that analyses an images from a picturebox and gives me the location of each black pixel inside the image and converts that to an excell sheet, so i can work from that.

I have put an example image in the attachment. I'm convinced the coding isn't that complicated, but i just can't figure it out.

I hope there is someone who can help me
Attached Images
File Type: png Dream.png (5.8 KB, 9 views)
Reply With Quote
  #2  
Old 09-03-2013, 06:21 AM
DrPunk's Avatar
DrPunkPixel positions in image DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

So which part are you struggling on?

The Bitmap class has a GetPixel method that returns the colour of the specified pixel -> http://msdn.microsoft.com/en-us/libr....getpixel.aspx

With that, it's easy enough to loop through an image checking the colour of each pixel.
Code:
dim b as bitmap 
dim x as integer
dim y as integer

b = image.FromFile(SomePathToAnImage)

for x = 0 to b.width - 1
    for y = 0 to b.height - 1

        If b.GetPixel(x, y) = Color.Black then
            ' Pixel at x, y is black
        end if

    next
next
Note that this isn't the quickest method, but probably the easiest.
__________________
There are no computers in heaven!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Pixel positions in image
Pixel positions in image
Pixel positions in image Pixel positions in image
Pixel positions in image
Pixel positions in image
Pixel positions in image Pixel positions in image Pixel positions in image Pixel positions in image Pixel positions in image Pixel positions in image Pixel positions in image
Pixel positions in image
Pixel positions in image
 
Pixel positions in image
Pixel positions in image
 
-->