Create a new image Complete from VBA code

M

mpfohl

I have a form I'd like to simulate a very basic animation based on
underlying data. (I use the term 'animation' losely).

Basically, I want to be able to move an image around the form, change
the width/height/coordinates depending on what the data values are
underneath.

I can do this if I have the initial image no problem, however I run
into trouble if I want to create another image based off that original
tempalte. Is there a way in VB code to completely copy an existing
Image object on the form, basicaly cloning it, so I can move around
both copies of the image independently?

My current workaround is to have several hidden copies of the same
image, and then unhide a new one each time I want a new copy, but that
means I have to have a finate number of images, and I'd rather be able
to use the image objects in a collection in the VB code, creating as
many new ones as needed by copying the original template's
properties. This is my poor-mans attempt at adding moving graphics to
MS Access.

Thanks,
 
L

Linq Adams via AccessMonster.com

This short answer is very simple; Access is an application designed for the
implementation of serious databases! It is not a graphics animation program!
 
A

Arvin Meyer [MVP]

Not at runtime, but suppose you created the second image and set its visible
property to false. Then when you needed it, just make it visible at runtime
and work your magic.
 
S

Stephen Lebans

I'm not 100% sure what exactly you are tryin g to accomplish but you can
simply copy the ImageData property of the original Image control to your
single empty Clone Image control. You would only need to have 2 Image
controls on your form.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
M

mpfohl

This short answer is very simple; Access is an application designed for the
implementation of serious databases! It is not a graphics animation program!

:) I know it isn't a program for animations, and i'm not trying to
fully animate a huge project. I'm simply trying to add a little color
to an otherwise bland form beyond just graphs and charts.

I basically have a cartoon clipart type image on a form. The form is
connected to a table and there could be anywhere from 1 to 10 records
(at this point). It will look at a certain field in each record and
if the number is high, the clipart guy will stretch taller, if it is a
low number, he stretches down shorter. Cutsey I know, but come on, we
can't all take Access too seriously all the time.

Lebans, correct me if I missunderstand your comments, but it sounds
like your way is what my current 'workaround' is. I'd have to create
10 images and keep them on the form hidden, then unhide and stretch
each one as need be. However, if I ever want to have an 11th 'cartoon
guy', then i'd be out of luck. Thus, i'd like to some how create the
image strictly through the VB code, possibly by copying the first
'template' image and create a new one, or something like that.

I guess i could progarm my little thing in Java or something like that
instead, but to be honest this has become a fun challenge. Any
thoughts?
 
S

Stephen Lebans

Why don't you simply use one Image control, set the Height of the control in
relation to the criteria field you mentioned. As long as the Image control's
SizeMode property is set to Stretch you will achieve the desired effect.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top