?
Solved

how to get pixels

Posted on 2008-11-04
8
Medium Priority
?
477 Views
Last Modified: 2012-05-05
Hi experts,

I am drawing (colored lines) scribbles on the image, How can I get the  pixel values(ie x and y) inside the selected area. I have got points( x and y) for selected area. I have attache bmp file containing selection pl see.

 I need each and every point inside selected area.
test.bmp
0
Comment
Question by:inampudi1
  • 5
  • 2
8 Comments
 
LVL 29

Expert Comment

by:chilternPC
ID: 22874550
Hi, here are 2 tutorials on how to do this manually.  I personally use dreamweaver which can produce the coordinates automatically.
you'll need to set up a polygon:

http://www.elated.com/articles/creating-image-maps/
http://www.javascriptkit.com/howto/imagemap.shtml
0
 

Author Comment

by:inampudi1
ID: 22874608
Hi,

I need some algorithm  to get [x,y] valuesas into a unsigined char*.......Here some code is their  in java. is their any algorithm for that?
0
 

Author Comment

by:inampudi1
ID: 22874645
Hi,

   Here my selected area may not be  exactly rectangle or triangle or hexagonal, it may be irregular shape also.

But I need all  pixel values inside my selection. Here I have input as co-ordinate values of border of selected area.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 29

Expert Comment

by:chilternPC
ID: 22874701
you will have to look at how HTML does it.  its done by html
for instance a circle would something like:
<map name="Map"><area shape="circle" coords="50,18,9" href="test.asp">
</map>
and placed at the end of the html page.  All we know is the centre of the circle and the raduis
another example:  html does the rest.

http://www.december.com/html/demo/imagemap.html
0
 

Author Comment

by:inampudi1
ID: 22874795
hi,

   Actually I dont no HTML, and I have to get inside pixel values in to a  variable  and I need to pass it to some other function in my application. Is their any other way....or how can I use your method for iregular shapes , as I showned in attached image.

0
 

Author Comment

by:inampudi1
ID: 22874802
Hi,


Here I am working on delphi ... if any algorithm is their means I can implement it.
0
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 2000 total points
ID: 22958422
while you are drawing create an array with (x, y) points
then use the CreatePolyPolygonRgn() function to create a windows region
then you can run over the image from top to bottom and left to right giving you a image (x, y)
then use PtInRegion() function to see if the point is in the region
that should do it
0
 

Author Comment

by:inampudi1
ID: 23244444
hi

I got the solution now it is working fine.
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a Synology DS212+ NAS.  These are not only great for backup and normal NAS stuff, but also for delivering media throughout your home or LAN via DLNA.  I copied my whole audio collection from iTunes over to the box, but couldn't figure out how…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
This video teaches viewers how to process images for a time-lapse video. Programs required: Adobe Lightroom, Adobe After Effects, Video Editing Program. In Adobe Lightroom: Import sequence image files into Adobe Lightroom: Develop settings of an I…
Viewers will learn the basics of using Ableton Live's advanced sampler instrument, Sampler. Load new Sampler into an empty MIDI track: Select a sample and drop it into sample window in Sampler: Adjust pitch if necessary with Root Key setting: …
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question