WebCanvas Flickers Then Disappears when hosted on Linux

I not have expressed myself precisely enough. Indeed, the picture is drawn in Paint. My point was just to say that the control does exist in the DOM, and is not absent. Just that it does not show to my human eyes.

I should have written :
But yet, I could see no picture on the screen. Could it be that the bug lies in the generation of the picture, as it seems the control is indeed part of the page code ?

I am not the engineer. Just a curious user. The solution now rests in the hands of masters I am not :wink:

[quote=126373:@Michel Bujardet]I get it. It is the captcha one has to copy. Amazingly enough, I just tried this morning and now the bug manifests. But I do not have the app hanging. If I click send the window appears asking for a subject category, but I can dismiss it.

Just an idea : could an Image Well be used instead and have a chance to mitigate the bug until it is fixed by Xojo ?[/quote]
The problem didn’t start with this app until I added that canvas. After working on it further I’ve developed the impression that it’s occurring as a result of using DrawString in the Paint even of the canvas to render the image. Now I’m trying to create a picture outside of the canvas and then use an ImageWell to display the picture but so far I haven’t been able to get Picture.Graphics.DrawString to actually draw a string in the web app when creating a new picture. I can DrawRect and I can FillRect but I can’t DrawString.

I found what is going on, and what may even explain the canvas issue : usual fonts are probably not installed on your host, or visible to the web app the way they are to a desktop app. When I removed the TextFont from the drawstring example, this in the Shown event of an ImageWell worked perfectly :

p is a WebPage property

[code]Sub Shown()
p = new picture(me.width,me.height,32)
p.graphics.ForeColor=&cff0000

// Commented out // p.graphics.TextFont=“Helvetica”
p.graphics.TextSize=16
p.graphics.DrawString(“Hello world”, 10,20)

me.Picture = p
End Sub
[/code]

The trick is to let the web app pick the default font.

Pursuing my research, I applied the example at http://documentation.xojo.com/index.php/FontCount to the open event of a WebListBox :

Sub Open() For i As Integer = 0 To FontCount-1 me.addrow(Font(i)) Next End Sub

What do you know ? Helvetica is not there ! From what I can tell, most of the fonts in my Mac are here, but not good’Ol Helvetica. At any rate, it seems prudent to run such code on your host to see what is available, if the default font does not satisfy you.

I have also used the page scoped p to drawpicture in a canvas paint event, and it works fine, but have not attempted to run it on my 1701 host.

Helvetia won’t be. That font is owned by Adobe and is licensed to companies that want to include it. Try using Arial instead.

I tried every combination of things I could think of but the problem appears to be the WebCanvas.Paint event itself, for whatever reason, Safari gets all choked up when the app is running on a Linux server. I replaced the Canvas with an ImageWell, created a new picture with the necessary text and then set the Picture as the ImageWell.Picture. The problem I was having earlier with DrawString not drawing was the missing Helvetica font issue discussed above. Setting the TextFont to System solved that problem. In any case, replacing the Canvas with an ImageWell resulted in a stable app.