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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 (Colored) crosshair cursor extending to the whole image area?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Oct 29 2022 : 23:42:27
Some graphics programs use a (colored) crosshair cursor that extends to the WHOLE IMAGE AREA, for example:



I need such a cursor for a special purpose to select an image area. Is this supported in ImageEnView?
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 31 2022 : 20:07:09
Hi Peter

Inline should have no effect in that situation (I'm surprised the compiler does not give an error).

I don't get any performance issues with this. Though there was a typo in the code above, which I have now fixed (used bitmap sizes rather than the client).

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Oct 31 2022 : 05:16:35
Hi Nigel

Thank you for the code. It works well, although it has a certain lag when moving the mouse. (The Form with the Client-aligned ImageEnView fills the whole screen).

So I declared the MouseMove and the DrawCanvas procedures as INLINE:

procedure ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); inline;
procedure ImageEnView1DrawCanvas(Sender: TObject; ACanvas: TCanvas; ARect: TRect); inline;




But it didn't become much faster.
xequte Posted - Oct 30 2022 : 17:43:34
Hi Peter

You can do as follows:

procedure TForm1.Button1Click(Sender: TObject);
begin
  ImageEnView1.IO.LoadFromFile( 'D:\im.jpg' );
  ImageEnView1.ShowRulers := [ rdHorizontal, rdVertical ];
  ImageEnView1.Cursor := crNone;
end;

procedure TForm1.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X,
    Y: Integer);
begin
  ImageEnView1.Invalidate();
end;

procedure TForm1.ImageEnView1DrawCanvas(Sender: TObject; ACanvas: TCanvas; ARect: TRect);
var
  P: TPoint;
begin
  GetCursorPos( P );
  P := ImageEnView1.ScreenToClient( P );

  ACanvas.Pen.Color := clYellow;
  ACanvas.MoveTo( P.X, 0 );
  ACanvas.LineTo( P.X, ImageEnView1.ClientHeight - 1 );
  ACanvas.MoveTo( 0, P.Y );
  ACanvas.LineTo( ImageEnView1.ClientWidth - 1, P.Y );
end;




Nigel
Xequte Software
www.imageen.com