Image control - painting question?

Wilhelm Sanke sanke at hrz.uni-kassel.de
Sat Jun 9 10:04:43 EDT 2007


On Sat Jun 9, 2007, David Bovill david at openpartnership.net wrote:


> If you use the paint tools on a card without an image a new image 
> control is
> created. When you start to paint in an image, a new image is not 
> created and
> you can paint inside the image (sort of).
>
> The problem I have is that if that image is inside a group it does not 
> work
> - a new image is created so you cant hand paint the image. I don't 
> know the
> details but I was wandering if any of you kind folk out there that have
> worked on coloring book type things know the details of this? Is it an IDE
> specific thing or an engine thing? Can you get around it?



David,

I ran into almost the same problem two months ago. We had a discussion 
about this in thread "problems with grouped images" on this list. I had 
tried to apply scripted painting on a grouped image. Probably this group 
behavior is an engine bug, because it appears both in the Rev and 
Metacard IDE..

One factor of the workaround we/I found was to move the image 
temporarily out of the group, but this was not enough. What finally did 
the trick was to "set the imagedata of img x to the imagedata of img x" 
before moving the image out of the group. Do not ask me why this helped.

For your orientation here is part of my post of April 24:

"Both problems which I reported with grouped images are resolved at this 
moment, but there was one more aspect of the drawing graphics issue no 
one of us had mentioned before.

I had also tried to move the image out of the group, but that did *not* 
work with the following script

"set the relayergroupedcontrols to true
 put the layer of img "eins" into tlayer
 set the layer of img "eins" to top
 send "mouseup" to btn "shape distortions"
 set the layer of img "eins" to tlayer
 set the relayergroupedcontrols to false".

Next step: I imported a referenced image outside the group and applied 
the "distortion" button on it: Does not work.

Another step: Imported an image fully with its text data outside the 
group: Button "distortion" now shows the expected effects.

Next step: Imported an image fully with its text data into the group: 
Button "distortion" leaves the group image unaffected, but creates a new 
image outside the group containing the distortions.

There seemed to be some issue between text-of-image data and the 
imagedata, and next I tried to import a referenced image and immediately 
set its imagedata to its imagedata.
Outside a group the graphics were drawn, with the same image inside the 
group a *new* image was created as above.

Last test I performed on a referenced image inside the group:

I added the line "set the imagedata of img "eins" to the imagedata of 
img "eins"" as the first line to the script of the distortion button, 
then applied the first script above to move the image temporarily out of 
the group:

Alas, this finally works (maybe as one of more possible workarounds?)!

Thanks to all who tried to help to figure this out."

Best regards,

Wilhelm Sanke
<http://www.sanke.org/MetaMedia>




More information about the use-livecode mailing list