Adding and Drawing Images in Small Basic

2021-10-29T20:12:00.467+00:00

Hi all. I've been trying to teach my students how to add/draw images in Small Basic. I found a program for a game in the book ***

Learn to Program with Small Basic: An Introduction to Programming with Games, Art, Science, and Math

*** but when I try to run the program on the school computers it crashes or nothing happens.

The part of the code that I am having problem with is this:
145103-image.png

specifically lines 15 and 16.

It was suggested that I get rid of path and add in the specific path but it does not help. Any suggestions? Thanks for your help.

-Araceli

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,115 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Scout 541 Reputation points
    2021-10-31T12:27:54.88+00:00

    Hi Araceli,
    Amazingly, Small Basic does not issue an error message when Shapes.AddImage (ImageName) uses a URL or a filename.
    However, the correct way to proceed is:
    First load the image with
    img_xyz = ImageList.LoadImage ("Filename or URL")

    into RAM memory and then with
    shape_n = Shapes.AddImage (img_xyz)

    create one or any number of shapes.

    One example is Nonki's Abacus program MNV389-3

    Note to all Small Basic users: The book listed above is available on ZLibrary as a PDF(EarlyAccess Version). The resources for this are available on Nostarch.

    @Araceli Martínez Morales , please add a small basic tag so that it can also be assigned to Small Basic.
    Thanks very much.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.