Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 4060

The deeepening mystery… Canvas!

$
0
0

In the current main window, I have set a bunch of Canvas and create a Control Set (except one whoi had code and I keep it to be able to test other features).

So, I had it working: six or seven Canvas had each one an unique image that came from data folders… I powered off the computer and goes to my “desktop”. After a reboot, I worked on that project (other parts), and run it to discover the icons are no more loaded / displayed. Fortunately, I’ve made a snapshot and, yes that worked some hour(s) ago !

This night, I wanted to check why, and this time I created a brand new project with the current Xojo. What was my surprise to discover… my code works (how can it not be, see it below).

I was thinking, it’s my working Xojo version who have the problem. I created the same example with Xojo 2021r2.1 and… it worked !

At this stage, my anger grows. I loaded my project (where it do not works anymore), add a window, addsome Canvas, set the code in a button and copy/paste the code: it works !

Back to my main window Open Event, comment everything excepted the relevant code who proved to be working elsewhere and… still not working.
I commented the code in App.Open (not needed for the test, check my main window, find code in Canvas1.Open: commented.
Clear the Caches, even power off…Power On, run Xojo, load the project, run: no image in my canvas !
My boot SSD have plenty room, no other running application.
WiFi was OFF.

No explanation from here !

Here’s the used code:

Dim f As New FolderItem("H Foster.png")

cGraphics(0).Backdrop = Picture.Open(f)
cGraphics(1).Backdrop = Picture.Open(f)

cTarzan.Backdrop = Picture.Open(f)

cCharacter(5).Backdrop = Picture.Open(f)

Ach ! I forgot: I add two more Canvas and set then as Control Set AFTER creation time (unlike the others: I add one Canvas, set it as a Control Set, and duplicate them 27 times…
This just in case it makes a difference.

BTW: the above code was running without result in wMain.Open, then I cut it from there and Paste it in a brand new button, run, click, same behavior: no icon on screen.

Who will resolve the mystery ?

PS: I can provide an example with the image, if needed, but the example works fine, thank you. :wink:

Here’s a screenshot of the working example:

14 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 4060

Trending Articles