quote ===================
c = i; //copy image ???
The copys the refrence.
Read:
http://www.javaranch.com/campfire/StoryCups.jsp You need to create a new Image, then draw the old i1 onto the new i1.
========================
My original post was a bit hard to follow sorry about that
I understand References, (at least in a c++ sense)
The following is a simplified version of what I am trying to accomplish
Shouldnt the following be valid
CODE -----------------------------------------------
Image i1; // null image reference
Image i2; // ditto
i1 = getImage(...); //new image created and its reference assigned to i1
i2 = i1; // now both i1 and i2 'refer' to the same image
i1 = getImage(...); // now i1 is assigned a reference to another new image
// i1 no longer points ('refers') to the same image as i2
--------------------------------------------------
I would have expected the last comment to be true, it appears it is not.
Instead it appears that getImage( ... ) re-uses the image referenced by i1 therefore invalidating i2 at the same time.
I will try the following to see if it makes a difference
CODE-------------------------------------------
Image i1; // null image reference
Image i2; // ditto
i1 = getImage(...); //new image created and its reference assigned to i1
i2 = i1; // now both i1 and i2 'refer' to the same image
*** i1 = null; **** i1 no longer points ('refers') to the same image as i2
i1 = getImage(...); // now i1 is assigned a reference to another new image
// i1 and i2 should now contain references to two distinct image objects
-----------------------------------------------
At this point I should have two images I can use as required
Is that correct or am I missing something fundamental here ?
[ September 07, 2005: Message edited by: Chris Topher ]