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
 Rulerbox like Photoshop
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

harry stahl

Germany
62 Posts

Posted - Jul 25 2016 :  17:43:44  Show Profile  Reply
I want to use the rulerbox like in Photoshop, that means Image centered. To adjust the zero-Point I do it like this:


HorizRuler.ViewPos := -ImageEnView1.OffsetX;
VertRuler.ViewPos  := -ImageEnView1.OffsetY;


The MousemoveEvent I have adjusted like this:


procedure TForm1.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  if Lockgripstointegervalue1.Checked then
  begin
    HorizRuler.GripsPos[0] := trunc(ImageEnView1.XScr2Bmp(X) / m_dpi) - ImageEnView1.OffsetX;
    VertRuler.GripsPos[0]  := trunc(ImageEnView1.YScr2Bmp(Y) / m_dpi) - ImageEnView1.Offsety;
  end
  else
  begin
    HorizRuler.GripsPos[0] := ((ImageEnView1.ViewX - HorizRuler.OffsetX + X) / HorizRuler.DotPerUnit) - ImageEnView1.OffsetX;
    VertRuler.GripsPos[0]  := ((ImageEnView1.ViewY - VertRuler.OffsetY + Y) / VertRuler.DotPerUnit) - ImageEnView1.Offsety;
  end;
end;


All works fine:



But it works not, when the Image is zoomed. What can I do here, to adjust the postion of the mouse-grip and the start of the zero-point?

And an other point: when the Image is zoomed, I want that the rulerbox is zoomed also (and not with a new numbering, see screenshot):



By the way: In an later update it would be fine, if one could link the Horizontal and vertical rulerbox to the ImagenEnview via the object-inspector and all this work what now has to be done by the developer would be into the "intelligent" rulerbox.

HS

xequte

38610 Posts

Posted - Jul 27 2016 :  00:34:28  Show Profile  Reply
Hi

I'm working on an updated demo...



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

harry stahl

Germany
62 Posts

Posted - Jul 27 2016 :  16:08:03  Show Profile  Reply
That is fine. If possible, it would be helpful to post it here (or in the demoe section of your homepage).

HS
Go to Top of Page

xequte

38610 Posts

Posted - Jul 30 2016 :  23:48:10  Show Profile  Reply
Hi Harry

I won't post it just yet, because it uses some v6.3.1 features. But if you want it to fix your Photoshop ruler issue, just email me.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

harry stahl

Germany
62 Posts

Posted - Jul 31 2016 :  17:42:44  Show Profile  Reply
OK, I've send you an email.

HS
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: