Zooming using TScrollBox:Still having problems
Hi!
I am still having troubles implementing a zoom using TScrollBox. I want
to zoom in on an image when a button is clicked. The problem is, is
that the image is not refreshed until one of the scroll bars from
TscrollBox is clicked. This is about driving me crazy, so I would
greatly appreciate it if someone could tell me what Im doing wrong or
send me some code that shows how to do this. I wrote a simple test
program as follows.
Place TButton component on Form.
In Button1->Click event place the following code:
ScrollBox1->HorzScrollBarRange += 100;
ScrollBox1->VertScrollBarRange += 100;
Place TScrollBox component on Form.
Set TScrollBox->Width = 300
Set TScrollBox->Height = 300
Set TScrollBox1->HorzScrollBar->Range = 300
Set TScrollBox1->VertScrollBar->Range = 300
Place TImage component onto TscrollBox component.
Set TImage->Align = alClient
Set TImage->Stretch = true
Set Timage->Center = false
Timage->AutoSize = false
Load a BitMap into Timage->Picture
Run the program.
When Button1 is clicked, the ScrollBar Ranges change which can be seen
as the scrollbars become smaller. However, the image is not zoomed
until the user clicks on one of the ScrollBars. How can I fix this?
Ive tried everything I can think of including updating, refreshing and
reloading the image, but nothing works.
Please Help!
Thanks,
Jen