DesktopCanvas Size problem

Okay the actual code I’m writing is somewhat extensive and I won’t copy it all here but I have narrowed the code down to a few statements that repeat the problem:

I have a window on a Desktop App (2024 2.1 on macOS Tahoe) with a
desktopcanvas on the window named cSubstrate. In the window’s OPEN event I have the following statements:

cSubstrate.Width = 500
cSubstrate.Height = 400
cSubstrate.Backdrop = GrayLightH
cSubstrate.Refresh

Then I have a button on the window that executes the following code:

cSubstrate.Width = 400
cSubstrate.Height = 500
cSubstrate.Refresh
Return

The result is the Canvas redisplays with a width of 400 and a height of 400. There is plenty of room on the window for the added height.

Can someone offer an idea?

thanks

Are you sure about the final Height or may it be you just “see” 40000 transparent pixels? :smiley:

I’m not seeing this behavior in a simple test:

desktopCanvas1.xojo_binary_project.zip (5.2 KB)

What are the dimensions of the GrayLightH image?

You suspect the same thing as me. The canvas will probably measure 400x500 pixels, but 40000 of them are transparent. :wink:

Thanks so much guys. Bonehead error. it was the size of the backdrop image.

thanks again.