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
 How to replace ImageEn Scrollbars?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
725 Posts

Posted - Mar 30 2020 :  00:56:31  Show Profile  Reply
Hello,

I have a need where I need to change the color and side of automatic scrollbars that are show in ImageEnView.

Can we do this?

If not then how to replace with a scrollbar control?

TIA


Yogi Yang

xequte

38179 Posts

Posted - Mar 30 2020 :  05:50:00  Show Profile  Reply
Hi Yogi

You can use VCL theming, other than that you would need to set Scrollbars to None and implement your own scrollbars (i.e. setting ViewX/ViewY).


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
725 Posts

Posted - Mar 30 2020 :  07:19:10  Show Profile  Reply
Hello Nigel,

I know that but how do I get the max scroll range because that would depend on the level of zoom?

Another thing the Zoon In/Out only fires when ten user zooms not when it is done with code like calling Fit. How to overcome this tiny problem?

TIA


Yogi Yang
Go to Top of Page

xequte

38179 Posts

Posted - Mar 30 2020 :  18:11:53  Show Profile  Reply
Hi Yogi

You can do it the same as ImageEnView.

Scrollbar has range 0 - 65536...

HorzScrollbar1.Min := 0;
HorzScrollbar1.Max := 65536;


To get position for horz scrollbar...

ImageEnView1.GetMaxViewXY( maxX, maxY );
valsX := ( maxX + ImageEnView1.ClientWidth ) / 65536; // Note: subtract ruler width if you have visible rulers
HorzScrollbar1.PageSize := trunc( ImageEnView1.ClientWidth / valsX );
HorzScrollbar1.Position := trunc( ImageEnView1.ViewX / valsX );

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

xequte

38179 Posts

Posted - Mar 30 2020 :  18:12:42  Show Profile  Reply
Also, use the OnViewChange event to update it.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
725 Posts

Posted - Apr 01 2020 :  01:03:48  Show Profile  Reply
Hello Nigel,

Thanks for the sample code. Though I am not able to get it to work but am trying...

In case of ImageEnView the scroll thumb size of the scrollbar enlarges or shrinks as we zoom out or zoom in. How is this possible if we keep the HorzScrollbar1.Max at 65536?

TIA


Yogi Yang
Go to Top of Page

xequte

38179 Posts

Posted - Apr 01 2020 :  15:34:25  Show Profile  Reply
Hi Yogi

Do you mean the PageSize? I've added it to the example above.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
725 Posts

Posted - Apr 19 2020 :  07:27:56  Show Profile  Reply
Hello Nigel,

After trying everything that I could I am not able get my scrollbars to work in ImageEn.

Can you please guide me as to where I am making mistake.

I am attaching a sample project here.

TIA

attach/yogiyang/202041972745_IEScrollBars.zip
57.99 KB


Yogi Yang
Go to Top of Page

xequte

38179 Posts

Posted - Apr 19 2020 :  16:36:57  Show Profile  Reply
Hi Yogi

Here you go:

www.ImageEn.com/files/Other/IECustomScrollBars.zip

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
725 Posts

Posted - Apr 20 2020 :  00:21:07  Show Profile  Reply
Hello Nigel,

Thanks I will go through the example.

TIA


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