PC Review


Reply
Thread Tools Rate Thread

bitmap reverse coordinates

 
 
Ron Dahl
Guest
Posts: n/a
 
      24th Nov 2004
Thanks Robby and Bob Powell for excellent answers on yesterday's question
about reversing coordinates in gdi+

I guess this is a new question.

My first step is that my bitmap is an aerial photograph of an agricultural
field. I use the .getpixel method to search for a certain color, then I
make a polygon around that color (weeds, high yield areas, etc.)
My bitmap is 440x 440.

I would like the getpixel method to use the reversed coordinates, so that if
I found a color in the lower left it might return point(10,10) instead of
point(10,430).

Then I use some math functions to get slopes, degrees of curvature, etc. I
wanted to reverse the y coordinates before the math functions, so the
results look more intuitive.

From there, I bring the bitmap into a graphics object and draw on it, again
using the reversed y coordinates.

I hope this question makes sense and thanks in advance for any help.
Ron Dahl


 
Reply With Quote
 
 
 
 
Robby
Guest
Posts: n/a
 
      25th Nov 2004

The Bitmap.GetPixel method takes the X and Y coordinate of the pixel and
returns the colour. Once you have your match use the TransformPoints method
of the Graphics object to transform them. Then you can run your math
procedures on them and get intuitive results.

--Robby




"Ron Dahl" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Thanks Robby and Bob Powell for excellent answers on yesterday's question
> about reversing coordinates in gdi+
>
> I guess this is a new question.
>
> My first step is that my bitmap is an aerial photograph of an agricultural
> field. I use the .getpixel method to search for a certain color, then I
> make a polygon around that color (weeds, high yield areas, etc.)
> My bitmap is 440x 440.
>
> I would like the getpixel method to use the reversed coordinates, so that
> if I found a color in the lower left it might return point(10,10) instead
> of point(10,430).
>
> Then I use some math functions to get slopes, degrees of curvature, etc.
> I wanted to reverse the y coordinates before the math functions, so the
> results look more intuitive.
>
> From there, I bring the bitmap into a graphics object and draw on it,
> again using the reversed y coordinates.
>
> I hope this question makes sense and thanks in advance for any help.
> Ron Dahl
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert point coordinates -> pixel coordinates Zorro Microsoft Excel Programming 1 1st Jun 2006 03:26 AM
gdi+ reverse coordinates Ron Dahl Microsoft VB .NET 2 24th Nov 2004 09:04 AM
Simple way to convert UTM ED50 coordinates to decimal coordinates? Dan Microsoft Excel Programming 8 11th Jul 2004 04:54 PM
Simple way to convert UTM ED50 coordinates to decimal coordinates? Dan Microsoft Excel Misc 10 11th Jul 2004 04:54 PM
Converting MouseDown Coordinates to Chart Point Coordinates Steve Microsoft Excel Programming 3 2nd Dec 2003 06:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 AM.