Page 1 of 1
How to know if an image changed
Posted: Mon Mar 01, 2010 7:00 pm
by jmburnod
Hi All,
i need to know if an image changed after using painting tool
I try a way by imagedata but it not work
Code: Select all
on tMemeIMDT pImage
set the text of img pImage to ""
set the MonImageData of img pImage to the imagedata of img pImage --•• MonImageData is a custom propertie
put VerifMemeImagedata(pImage) into Meme --•• return false
end tMemeIMDT
function VerifMemeImagedata pImage
if the MonImageData of img pImage = the imagedata of img pImage then
return true
else
return false
end if
end VerifMemeImagedata
Of cours, an other way is welcome
Regards
Jean-Marc
Re: How to know if an image changed
Posted: Mon Mar 01, 2010 7:42 pm
by bn
Jean-Marc,
jmburnod wrote: set the text of img pImage to ""
if you set the text of an image to "" or empty you clear everything out of the image, the imagedata will be empty
try without "set the text of image ... to ""
than you say
Code: Select all
set the MonImageData of img pImage to the imagedata of img pImage --•• MonImageData is a custom propertie
put VerifMemeImagedata(pImage) --into Meme --•• return false
you set the custom property to the imagedata and right afterwards you ask if the customproperty = imagedata. For me it returns always true as it should, it never had a chance to change. Try to do the setting e.g. when you start going into an image/start paint modus. When ending paint modus and you want to know if anything has changed you make the comparison without first setting the custom property to the actual imagedata.
regards
Bernd
Re: How to know if an image changed
Posted: Mon Mar 01, 2010 9:22 pm
by bn
Jean-Marc,
I just tried your script and to my surprise the imagedata in the customproperty was empty, with text of image it worked
Code: Select all
on tMemeIMDT pImage
set the MonImageData of img pImage to the text of img pImage --•• MonImageData is a custom propertie
end tMemeIMDT
function VerifMemeImagedata pImage
return the MonImageData of img pImage = the text of img pImage
end VerifMemeImagedata
I call tMemeIMDT on mouseDown and VerifMemeImagedata with
Code: Select all
put VerifMemeImagedata("nameOfMyImage") into Meme
when I exit the painting routine. That works as expected
regards
Bernd
Re: How to know if an image changed
Posted: Mon Mar 01, 2010 9:50 pm
by jmburnod
Yes Bernd,
"text" instead "Imagedata" and the function work
Code: Select all
function VerifMemeImagedata pImage
return the MonImageData of img pImage = the text of img pImage
end VerifMemeImagedata
It work also after creating a new image empty by set the text of img pImage to ""
That is what i need now (for the painting palette without mousedown)
Thank one more.
I hope i can help you one time
Guten Abend
Jean-Marc