Re-create a closed canvas?

Hi,
if I close a Canvas - is it possible elsewhere in my app, to be able to re-create the same Canvas in the same position as it originally appeared?

Am I correct in thinking that I could do something like:

Dim Canvas2 as new Canvas Canvas2.left = 20 Canvas2.background = my image blah blah blah

Or am I completely wrong?

Thank you in advance.

I can’t make it invisible because the canvas is over the top of a Text Area, and if I simply set it to invisible - the user is not able to select any text in the underlying Text Area.

[quote=85639:@Richard Summers]I can’t make it invisible because the canvas is over the top of a Text Area, and if I simply set it to invisible - the user is not able to select any text in the underlying Text Area.
[/quote]

So move it off window as well:

c.left = 100 - c.width

Brad,
will try that now.

Thanks.

Why are you putting a canvas over a text area in the first place ?

Because the text area cannot have any cue text - so I display an image with information, and the image fades out upon clicking.

if it is te

Ah ok
Disable the canvas, hide it & move it so it is not sitting on top of the text area
That certainly seems simplest

The problem seems to be that I use the code below to fade out the Canvas containing the image, and if I make the canvas visible - it is still transparent.

If that makes sense :slight_smile:

[code] If CueImageSeen = false then

Dim p as Picture
dim h, w, i as integer

w = Canvas1.Width
h = Canvas1.Height

p = new picture(w,h)
p = Canvas1.Backdrop
p.Graphics.ForeColor = RGB(255,255,255)

if FadeColor <255 then
  fadeColor = fadecolor + 10
  p.mask.graphics.forecolor=rgb(fadecolor,fadecolor,fadecolor)
  p.mask.graphics.fillrect (0,0,w,h)
  p.Graphics.DrawPicture fadetext,0,0
  canvas1.Backdrop = p
  
else
  Canvas1.close
  Timer2.mode = 0
  CueImageSeen = true
end if

end if[/code]

Here is what I just did on a project…

create a TextEdit (mytext) and Label (win_cueText)
in the OPEN event of your TextField

  win_cueText.left=mytext.left
win_cuetext.top=mytext.top
win_cuetext.text="Whatever you need to say"

In the TEXTCHANGE event of your TextField

win_cueText.Visible=(len(me.text)=0)

Dave - that is perfect for future reference, and I will definitely use that at some stage.

However, because my TextArea is so large, the text would seem a little lost - therefore I made a large image which looks really nice (if only I could get it to appear again).

:slight_smile:

[quote=85666:@Richard Summers]The problem seems to be that I use the code below to fade out the Canvas containing the image, and if I make the canvas visible - it is still transparent.
[/quote]
Sure - it retains its settings
So when you show new cue text you’ll have to set the transparency etc back to how you want it to appear as cue text
And then fade it out

A custom canvas subclass that has something like a “Show” method that takes a text message to show and it then sets up things so they show how you want the text to show
And you could even encapsulate a timer or whatever in that so it fades when clicked

That’s my problem Norman - I do not know how to get it totally opaque again?

I tried Canvas1.Transparent = false, but that did not work, and I can’t see any other properties in the Language reference which would be appropriate?

Has more to do with the image you drew into the background
You need to draw it not faded

??
Do you mean that the modified code below would make it opaque again?

[code]Dim p as Picture
dim h, w, i as integer

w = Canvas1.Width
h = Canvas1.Height

p = new picture(w,h)
p = Canvas1.Backdrop
p.Graphics.ForeColor = RGB(0,0,0)
p.mask.graphics.forecolor=rgb(0,0,0)
p.mask.graphics.fillrect (0,0,w,h)
p.Graphics.DrawPicture fadetext,0,0
Canvas1.Backdrop = p[/code]

I would imagine so since you’d be replacing the faded out image with a new one when yo execute

canvas1.Backdrop = p

Thanks, will try that when I get the chance.