A bigger eraser or a work around

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

A bigger eraser or a work around

Post by magice »

The maximum size of the eraser tool is 32x32 pixels. I assume this is because of cursor size limitations in windows. When I try to apply a larger image (128x128) LC shuts down. Is there a workaround? It seems to me that the paint tool itself had to be coded, so there must be a way to say "remove the paint from an image in a designated area"
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: A bigger eraser or a work around

Post by dunbarx »

Hi.

On a Mac, I find no issue with very large erasers, set say, from a large img imported as a control and the eraser property set to that ID. Must be a Windows thing.

But your thought of being able to:

Code: Select all

remove paint from rect "yourRect"
or

Code: Select all

remove paint from the extent of control "yourControl"
Where "yourControl" might even be a polygon of odd shape, or a circle, whatever, is interesting.

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

Re: A bigger eraser or a work around

Post by richmond62 »

If I create a new stack and then squiggle all over it with the brush tool
as soon as I stop squiggling I end up with an image overlaying any controls
beneath it.

So surely the best way to "remove paint" is simply to delete the last image?
rPaint1.png
rPaint2.png
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: A bigger eraser or a work around

Post by magice »

dunbarx wrote:Hi.

On a Mac, I find no issue with very large erasers, set say, from a large img imported as a control and the eraser property set to that ID. Must be a Windows thing.

But your thought of being able to:

Code: Select all

remove paint from rect "yourRect"
or

Code: Select all

remove paint from the extent of control "yourControl"
Where "yourControl" might even be a polygon of odd shape, or a circle, whatever, is interesting.

Craig
After reading your post I did some experimentation. Nothing seems to work in my stack. However i created a new stack and it works. I believe that my stack is corrupt. It might have something to do with the fact that I am revamping an app that I wrote over five years ago in a much older version (RunRev 3.0). I guess I need to start over from scratch.
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: A bigger eraser or a work around

Post by FourthWorld »

magice wrote:Nothing seems to work in my stack. However i created a new stack and it works. I believe that my stack is corrupt. It might have something to do with the fact that I am revamping an app that I wrote over five years ago in a much older version (RunRev 3.0). I guess I need to start over from scratch.
If you can open the stack at all it's probably not corrupt. What problems are you seeing?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: A bigger eraser or a work around

Post by magice »

FourthWorld wrote: If you can open the stack at all it's probably not corrupt. What problems are you seeing?
in my original stack, I imported an image as a control. The ID of the image is 1165. When I use the following code, the stack and LC shuts completely down instantly.

Code: Select all

set the eraser to 1165
In a new stack the same code works fine. I have spent most of the night copying and pasting all of the items and scripts into a new stack. At this time I have completely rebuilt the stack and it seems to be working fine.
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: A bigger eraser or a work around

Post by FourthWorld »

magice wrote:in my original stack, I imported an image as a control. The ID of the image is 1165. When I use the following code, the stack and LC shuts completely down instantly.
It sounds like at worse the image object alone may be corrupted, but the stack is fine. What happens if you delete the image and replace it with a new copy?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: A bigger eraser or a work around

Post by magice »

FourthWorld wrote:
magice wrote:in my original stack, I imported an image as a control. The ID of the image is 1165. When I use the following code, the stack and LC shuts completely down instantly.
It sounds like at worse the image object alone may be corrupted, but the stack is fine. What happens if you delete the image and replace it with a new copy?
The same thing, I tried it several times with GIFs, PNGs, and JPGs of diferent sizes. The Gif's and PNG's I tried both with and without alpha channels. Anyway, I am not going to worry about it now. The new stack is working perfectly.

EDIT: And yes I did change the ID number in the script appropriately before you ask. :)
Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: A bigger eraser or a work around

Post by Da_Elf »

the paintbrush works when editing inside of livecode but how is it used when working outside of the livecode interface as an external program? ive searched for how to make drawing programs and i only found the method of creating a graphic and it stores points for the graphic
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: A bigger eraser or a work around

Post by magice »

Da_Elf wrote:the paintbrush works when editing inside of livecode but how is it used when working outside of the livecode interface as an external program? ive searched for how to make drawing programs and i only found the method of creating a graphic and it stores points for the graphic

Just include "brushes" and it works in a stand alone as well.
Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: A bigger eraser or a work around

Post by Da_Elf »

how do you "include" it? ive been looking for a walkthrough but cant even find much info anywhere on the site
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: A bigger eraser or a work around

Post by magice »

Da_Elf wrote:how do you "include" it? ive been looking for a walkthrough but cant even find much info anywhere on the site
In standalone settings, I believe on the first page, there is a radio button to check to enable the inclusion then a checkbox to include it.
Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: A bigger eraser or a work around

Post by Da_Elf »

right so i see how to include brushes. now how is it actually used? On the livecode page im not getting any tutorials, none googleing it, and typing paint into dictionary doesnt give me much info on its use.

this is the closest i can come to its use
http://lessons.runrev.com/m/4603/l/44144-using-images
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: A bigger eraser or a work around

Post by magice »

Da_Elf wrote:right so i see how to include brushes. now how is it actually used? On the livecode page im not getting any tutorials, none googleing it, and typing paint into dictionary doesnt give me much info on its use.

this is the closest i can come to its use
http://lessons.runrev.com/m/4603/l/44144-using-images
Look up "choose" in the dictionary. You can also look up brush, eraser,dropper etc, but I believe choose will lead you to the most info. Also keep in mind that you cannot edit a referenced image. You have to import paint from the image.
Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: A bigger eraser or a work around

Post by Da_Elf »

thank you. thats all i needed was a point in the right direction
Post Reply