• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

Scrolling in TImage

Hi,

Does anyone know how to scroll within a TImage window. I wish to have a bitmap that is greater than the area I wish to display ( I do not wish to use stretch as this shrinks the picture).

I wish to scroll either by moving the cursor inside the image or with scroll bars.

In addition is there anyway to zoom the bitmap within the window.

If TImage does not do the job, is there any other components available that will do the job.

Regards

Chris
0
ChrisBerry
Asked:
ChrisBerry
1 Solution
 
kretzschmarCommented:
hmm chrisberry,

what about to drop a scrollbox on your form,
then drop a timage on it (topleft 0,0-Autosize true)
load your picture into it
ready
(just not tested yet)
meikl

0
 
RBertoraCommented:
Brilliant Meikl!
0
 
philipleighsCommented:
Hi Chris,

As for zooming, do what Meikl said but drop a paintbox instead. Set the paintbox width to zoomfactor * width and the height to zoomfactor * height.

In the OnPaint event of the paintbox, use stretchdraw to scale the bitmap.

(The bitmap could be a private form variable that you create in the FormCreate event, and free in the FormDestroy event. Alternatively, add a TImage and load a bitmap into it. Make the TImage invisible, and paint to the paint box using PaintBox1.Canvas.StretchDraw(Image1.Picture.Bitmap, ...

Cheers,
Phil.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
IndefreiCommented:
Quick and very good answers !
Hi, meikl
supposing you did get my second mail i'm gonna ask now some
questions.
take care, barry's still on the run
Indi
0
 
kretzschmarCommented:
hi indi,
yup you're right, i got your second mail,
mann vergeht die zeit schnell,
schon ueber eine woche her,
sorry for no response :-(

i can solve some parts of your request in a short term,
i will send it tomorrow (hoffentlich klappt das)
but you are free to ask here.

about barry, i'm sure he will catch me soon.

meikl ;-)
0
 
IndefreiCommented:
testing...
0
 
IndefreiCommented:
Testing..
I don't know, why i get this internal server error.
All test are going well
but not, what i wanna post here  
0
 
IndefreiCommented:
yeah, the great kiwi's got time enough as a prisoner
in the foreign England to answer everything he knows, and
he knows a lot. But sometimes i wonder, how he get's all
the points so quickly. Once i've been in EE for half an our
and suddenly his points raised up by 2000( Same with rWilson....) Well, no doubts about it,s ok, i guess.
Now he's a little bit flustered, cause his AB's (All Blacks NZ Team) lost in the semifinals of the
Rugby World Championchip in a very bad manner
against the european team of France.
I'm afraid, he'll die, if they gonna loose today against SA fighting for third place. The bets on ITV are 52-48 South Afrika...
Heh, Barry, far away from home the pain is double as hard, but don't lose heart, man !
Well, meikl
in my case there is no reason for you to be in a hurry.
I can wait some more days, no problem
Relax ruhig mal, soll Wunder wirken !
Aber ein, zwei Antworten waeren schon klasse ! bis dann Indi
0
 
IndefreiCommented:
the ! at the end of a line !
no
0
 
ChrisBerryAuthor Commented:
Thanks for all the answers.

Works fine - never used scroll box before so I never thought of this.

regards

Chris
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now