Cear picture does not work?

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderator: Klaus

Post Reply
dbeugeling
Posts: 12
Joined: Thu Feb 12, 2015 12:22 pm

Cear picture does not work?

Post by dbeugeling » Fri May 26, 2023 11:13 am

Hello,

Maybe I'm wrong, but I cannot get an Image cleared.

I made a button with this code:

on mouseUp pButtonNumber
put empty into image "imgOne" of card "crd1"of stack "stckPicDelete"
end mouseUp

but nothing happens!

Any Thoughts?

Dirk
Attachments
PicDelete.livecode.zip
(1.62 KiB) Downloaded 55 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10078
Joined: Fri Feb 19, 2010 10:17 am

Re: Clear picture does not work?

Post by richmond62 » Fri May 26, 2023 11:46 am

Well, I have just spent 15 minutes messing around and am getting nowhere, so I have a very silly suggestion as to how this might be solved:
-
SShot 2023-05-26 at 13.42.40.png
-

Code: Select all

on mouseUp
   put the width of img "imgOne" into WIDD
   put the height of img "imgOne" into HITE
   delete img "imgOne"
   create image
   set the name of the last image to "imgOne"
   set the showBorder of img "imgOne" to true
   set the width of img "imgOne" to WIDD
   set the height of img "imgOne" to HITE
   set the loc of img "imgOne" to 200,145
end mouseUp
Oh, and while I am 'here': please try to put bits of code in your messages like this:
-
SShot 2023-05-26 at 13.45.39.png
SShot 2023-05-26 at 13.45.39.png (43.72 KiB) Viewed 1675 times
Attachments
imageDelete.zip
Stack.
(117.06 KiB) Downloaded 60 times

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Cear picture does not work?

Post by Klaus » Fri May 26, 2023 11:52 am

Hi Dirk
dbeugeling wrote:
Fri May 26, 2023 11:13 am

Code: Select all

on mouseUp pButtonNumber
   put empty into image "imgOne" of card "crd1"of stack "stckPicDelete"
end mouseUp
that only works for IMPORTED images, but you have a REFERENCED image on your card.
This works in that case:

Code: Select all

...
set the filename of img "your pic" to EMPTY
...
Best

Klaus

dbeugeling
Posts: 12
Joined: Thu Feb 12, 2015 12:22 pm

Re: Cear picture does not work?

Post by dbeugeling » Fri May 26, 2023 12:47 pm

Hello Klaus,
Thank you for your fast reply!

Dirk

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Cear picture does not work?

Post by Klaus » Fri May 26, 2023 1:41 pm

Graag gedaan, Dirk! :-)

Post Reply