How to save a graphic on a card using paint tools
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How to save a graphic on a card using paint tools
Hi,
I've a script that draws a graphic (like a column chart) using the draw command. Before I start drawing I've set linesize and pencolor. The graphic draws smoothly and everything works as expected. However, when I go to another card the graphic is lost. It's also lost when I save the stack.
What am I missing here?
Martin
			
			
									
									
						I've a script that draws a graphic (like a column chart) using the draw command. Before I start drawing I've set linesize and pencolor. The graphic draws smoothly and everything works as expected. However, when I go to another card the graphic is lost. It's also lost when I save the stack.
What am I missing here?
Martin
Re: How to save a graphic on a card using paint tools
Hi Martin,
never heard of this problem!?
Sure there is no "pre-/opencard" handler that will "clean up" the card?
Best
Klaus
			
			
									
									
						never heard of this problem!?
Sure there is no "pre-/opencard" handler that will "clean up" the card?
Best
Klaus
Re: How to save a graphic on a card using paint tools
There's no openCard handler or any other handler that 'cleans up' the card. (If I want to draw a new graphic I use a button that cuts the rectangle of the graphic.)
			
			
									
									
						Re: How to save a graphic on a card using paint tools
OK, OK, just wanted to be sure. 
 
But what do you mean by:
			
			
									
									
						But what do you mean by:
Maybe you could post the script and/or stack here?(If I want to draw a new graphic I use a button that cuts the rectangle of the graphic.)
Re: How to save a graphic on a card using paint tools
To delete the previously drawn graphic I use this script:
choose select tool
drag from 0,0 to 560,744
cut
choose browse tool
Re: How to save a graphic on a card using paint tools
Sorry, I meant the script to create the graphic(s).
			
			
									
									
						Re: How to save a graphic on a card using paint tools
Check both the card and stack properties to see if the cantModify property is true. The symptoms sound like that's the case.
			
			
									
									Jacqueline Landman Gay         |     jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
						HyperActive Software | http://www.hyperactivesw.com
Re: How to save a graphic on a card using paint tools
Yes, but in that case you cannot even draw anything on a card at all!
			
			
									
									
						Re: How to save a graphic on a card using paint tools
Martin,
I think you run afoul of an LC bug that if you use the paint tools and you do not explicitly create an image object where you "paint" then LC creates an image object for you but the problem is that that image is not "stable".
Could you try to create an image object of the size and location you want first and then do your drawing-
This is just a hunch but worth trying.
A bit of code would help to track this down.
Kind regards
Bernd
EDIT:
the bug report is here:
https://quality.livecode.com/show_bug.cgi?id=24034
It was fixed in 10.0.2 RC-1
			
			
									
									
						I think you run afoul of an LC bug that if you use the paint tools and you do not explicitly create an image object where you "paint" then LC creates an image object for you but the problem is that that image is not "stable".
Could you try to create an image object of the size and location you want first and then do your drawing-
This is just a hunch but worth trying.
A bit of code would help to track this down.
Kind regards
Bernd
EDIT:
the bug report is here:
https://quality.livecode.com/show_bug.cgi?id=24034
It was fixed in 10.0.2 RC-1
Re: How to save a graphic on a card using paint tools
I think you can, you can do almost anything but leaving the card removes all changes. Maybe something changed?
Jacqueline Landman Gay         |     jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
						HyperActive Software | http://www.hyperactivesw.com
Re: How to save a graphic on a card using paint tools
Bernd.
I never use paint tools, though I remember back in 1987 I doodled a lot with HC.
In a new stack I made a small "drawing" using each of the seven standard paint tools in the toolbar, rectangle, line, brush, etc.
I saved the stack and re-opened. All the doodles except for the line and polygon disappeared. I tried it again, and only the line came back. And after a third time, everything disappeared.
I think there is something wrong here.
Craig
			
			
									
									
						I never use paint tools, though I remember back in 1987 I doodled a lot with HC.
In a new stack I made a small "drawing" using each of the seven standard paint tools in the toolbar, rectangle, line, brush, etc.
I saved the stack and re-opened. All the doodles except for the line and polygon disappeared. I tried it again, and only the line came back. And after a third time, everything disappeared.
I think there is something wrong here.
Craig
Re: How to save a graphic on a card using paint tools
Bernd.
Craig
			
			
									
									
						Why would that be of any use, even if it worked? The whole point of paint tools, awkward as they are, is lost if you have to prep them with an image. In that case, what do you need to paint for?Could you try to create an image object of the size and location you want first and then do your drawing-
Craig
Re: How to save a graphic on a card using paint tools
Bernd.
Well, I see what you meant. If you import an image, and I guess that could be 100% whiteSpace that fills the card window, then any painting you do within the rect of that image sticks. Note that you can only paint within the image rect because the tools fail to paint at all outside it. They will actually stop painting if the cursor leaves the image, and start up again when you return.
Craig
			
			
									
									
						Well, I see what you meant. If you import an image, and I guess that could be 100% whiteSpace that fills the card window, then any painting you do within the rect of that image sticks. Note that you can only paint within the image rect because the tools fail to paint at all outside it. They will actually stop painting if the cursor leaves the image, and start up again when you return.
Craig
Re: How to save a graphic on a card using paint tools
Craig,dunbarx wrote: ↑Tue Oct 28, 2025 8:36 pmBernd.Why would that be of any use, even if it worked? The whole point of paint tools, awkward as they are, is lost if you have to prep them with an image. In that case, what do you need to paint for?Could you try to create an image object of the size and location you want first and then do your drawing-
An image is created on the fly if you "just" paint. And the "automatic" image has the size of the card. Actually you probably want your image to have a certain smaller dimension. On top of this it was broken up until LC 10.0.2 RC-1.
I think the cleanest solution would be to create an image object of the desired dimension and paint into that image object.
Kind regards
Bernd
Re: How to save a graphic on a card using paint tools
Bernd.
I do not understand. If I paint a line on a new card, it is true that the rect of the "image" of that line fills the card window. Save that stack. It is lost if I close and reopen. An imported image, however, allows the paint to survive if that paint lies within the rect of that image.
What am I missing?
 
craig
			
			
									
									
						I do not understand. If I paint a line on a new card, it is true that the rect of the "image" of that line fills the card window. Save that stack. It is lost if I close and reopen. An imported image, however, allows the paint to survive if that paint lies within the rect of that image.
What am I missing?
craig
