ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Pixel Cursor
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

bmesser

United Kingdom
234 Posts

Posted - Aug 23 2013 :  09:18:29  Show Profile  Reply
Hi

I have discovered the DisplayGrid property that outlines each pixel in a grid when you have zoomed into a certain level. I already have functionality that attempts to draw a black rectangle around the selected pixel when you click in the image with the mouse. I have done this by means of the OnDrawBackBuffer action by drawing a small rectangle with the value of the color in it. The trouble is that they don't align exactly and this gets worse the more I zoom in (see screenshot). There maybe an example of how to do this because it must be quite a common problem, can anyone point me at it?

Bruce.

w2m

USA
1990 Posts

Posted - Aug 23 2013 :  10:38:53  Show Profile  Reply
This is already done for you with ImageEn.HighlightedPixel

Put this in the OnMouseMove event:

var
iP1: TPoint;

{ Highlight the selected pixel }
if (Paint1.Down) then
begin
  iP1.X := ImageEnView1.Layers[ImageEnView1.LayersCurrent].
    ConvXScr2Bmp(X);
  iP1.Y := ImageEnView1.Layers[ImageEnView1.LayersCurrent].  
    ConvYScr2Bmp(Y);
  ImageEnView1.HighlightedPixel := iP1;
  ImageEnView1.HighlightedPixelColor := clRed;
end;


William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

bmesser

United Kingdom
234 Posts

Posted - Aug 23 2013 :  12:37:54  Show Profile  Reply
Thanks Bill, I thought they might be a way but I must have missed that in the help.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: