Computer Science Canada

.bmp images don't work properly

Author:  aaeaeeeugh [ Wed Mar 23, 2022 8:40 am ]
Post subject:  .bmp images don't work properly

I'm making a space invaders game with images. These images were made in Piskel, exported as png and transformed into bmp.
In the program, these images, with transparent background, are black. Just black boxes moving around.

I have my images put into variable and shown using this (Turing 4.1.1):
Turing:


var myImage :int := Pic.FileNew ("image.bmp")

Pic.Draw (myImage, x, y, picMerge)



Would anybody have a solution for this?

Thanks in advance

Author:  scholarlytutor [ Wed Mar 23, 2022 4:53 pm ]
Post subject:  RE:.bmp images don\'t work properly

I think you might not be using the right module because that procedure from the Pic is for simple images, not ones with transparent backgrounds.

Have you tried looking at the Sprites module? I haven't used it but I believe that's what you would need.

I make my images with code using multidimensional arrays. If you're curious, feel free to look at the submissions section.

Author:  aaeaeeeugh [ Thu Mar 24, 2022 10:52 am ]
Post subject:  Re: .bmp images don't work properly

Those didn't work, but I tried putting a colored background and using Pic.SetTransparentColor and it worked. Thanks for answering tho!

Author:  scholarlytutor [ Thu Mar 24, 2022 10:46 pm ]
Post subject:  RE:.bmp images don\'t work properly

No problem, thanks for the update!


: