Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
yogiyang
Posted - Jan 23 2019 : 02:40:32 Hello,
This is for the first time that I have a need to actually scan all the pixels of the loaded image and select pixels based of a few rules as defined by user.
How can we read the individual values of R G B of each pixel and select those pixels as per user entered rules?
TIA
Yogi Yang
2 L A T E S T R E P L I E S (Newest First)
yogiyang
Posted - Jan 23 2019 : 06:52:03 Klaus,
Thanks for the code sample. I finally managed to get it working and it is quite fast also!
Once again thanks of the code.
TIA
Yogi Yang
klausdoege
Posted - Jan 23 2019 : 03:48:29 Hi Yogi, use: TImageEnView.SelectCustom
Example:
for y := 0 to ImageEnView1.IEBitmap.Height - 1 do
for x := 0 to ImageEnView1.IEBitmap.Width - 1 do
begin
color := ImageEnView1.IEBitmap.Pixels[x, y];
if ( color = clBlue ) or ( color = clGreen ) then
begin
ImageEnView.SelectionMask.SetPixel(X, Y, 255);
ImageEnView.SelectCustom();
end;
end;