Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find each pixel between two points in java?

Hello sir/mem i m making Desktop App in java Swing for doctor.I want to find each pixel value not count between two points.suppose i have one point (100,145) and second point is (173,190) and i want to get pixel between this two points.means every pixels of (x,y) value between that two points.so how can i do that?

like image 788
Jay Avatar asked Mar 27 '26 10:03

Jay


1 Answers

Look up the Bresenham algorithm. Here is an implementation in Java.

like image 165
Tomas Andrle Avatar answered Mar 30 '26 00:03

Tomas Andrle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!