Make new image views on the fly an move them

Hello to all members in forum.

I want to make new image views on the fly. The number of images is for every run an other.
I must can set the properties image,size and position of the image view

I have already two image views on my main screen but the new image views I want to make should lays over the existing views. The existing image views must be visible.

Is it possible to make new image views on the fly?
And is it possible to move an image view in the main window when the mouse is pressed down?
Please can someone help me?

Thanks for your help



You can not create objects on the fly. The only way to achieve this same effect is to create as many image views as you will need, and then turn their visibility on/off (or hide them outside the bounds of the window), and dynamically set the image of each if required. If you create image views that are transparent and have no border, you can use transparent gif images to create a layering effect. Managing the images may get a bit complicated and may not yield the desired effects when using lots of images… but if you’re just layering one image over another, this should work fine. Since jpg’s and most other formats are not transparent, using them would not likely allow you to get a layering effect, as only the top image would be visible.

To show or hide an image view…

set visible of image view "theImageView" of window "theWindow" to true --> Show
set visible of image view "theImageView" of window "theWindow" to false --> Hide

To move an item set it’s position, which is a two item list {left,bottom} relative to the window or view it’s in. The following clicked handler will move the image view up and right 20 pixels when the button “Move” is clicked

if name of theObject is "Move" then
	tell image view "movableImage" of window "theWindow"
		set {currentLeft, currentBottom} to position
		set position to {(currentLeft + 20), (currentBottom + 20)}
	end tell
end if

Good luck…