An empty Canvas?

Is there any reason why I have three canvasses in my window, two of them show its correct image and the third does not show at all?
They have the same paint code (except, of course, the name of the picture), and same parameters. I tried all I could think of but the third one refuses to show.

Can you show the same image on all 3? If not, maybe something is wrong with that canvas and you can try to delete it and add a Canvas again.
Can you show the image that is not showing on this canvas on the other 2? If not, maybe is something wrong with the image (name, resolution, wrong data)

If everything works fine (can show an image on all 3 and the problem image can display using the other 2), then provide a sample code and I’m sure someone will try to figure out what is wrong.

Things I would verify:

  • Canvas 3 is not outside the bounds of the window
  • Canvas 3 is not (completely) covered by other objects
  • Canvas 3 image is available; quick ways to test:
    • Try image for canvas 3 in canvas 1 or 2 – does it show?
    • Try image for canvas 1 or 2 in canvas 3 – does it show?

These things may help narrow it down.

I verified all you said: Canvas 1 doesn’t show image 3 if switched.
On the other end, image 3 shows correctly in a Canvas set in a different window.
I tried to remove and import image 3 again in the IDE, as well as I deleted and replaced the Canvas which, by the way, it is not covered by anything and sits well inside the window’s boundary. I even tried to move it around, just to be sure it was not covered by anything

Dim w, h, cw, ch as Double

w = Test.width

h = Test.height 

cw = me.width

ch = me.height

g.DrawPicture (Test, 0, 0, cw, ch, 0, 0, w, h)   //This is Canvas 1

Dim w, l as Double   

w = MiniStarfighter.width 

l  =MiniStarfighter.height 

g.DrawPicture (MiniStarfighter, 0, 0, w, l, 0, 0, w, l)  //This is Canvas 2


Dim w, l as Double

w = Altt.width

l =Altt.height

g.DrawPicture (Altt, 0, 0, w, l, 0, 0, w, l) /This is the failed Canvas

Alert.jpeg — Image 1
MiniStarfighter — Image 2
Altt __ Image 3

Regarding the third (non visible) image: is its width / height greater than the canvas width / height? I ask because the params you pass along to the canvas drawing (DrawPicture).

could it be Hi-DPI settings? (no image for this resolution)
Build Settings / Shared / Supports Hi-DPI

stretch to canvas i use
g.DrawPicture (pic, 0, 0, pic.width, pic.height, 0, 0, g.width, g.heigth)

No, they don’t, based on the code you posted. The first canvas, you’re resizing the image to fit the canvas. The other 2, you’re not.

Something that always throws me initially is when the image is much larger than the canvas and I’m not resizing the image. Invariably, the top left portion of the image will be blank and that’s the part that is visible in the canvas. The rest of the image is not. So the canvas appears to have nothing displayed.

I made it. It was just amatter of scaling to the right proportions.

Thanks everybody for your help