Hi,
The best way is to create your button images and save or create in a png and load from a file. You can save multiple images for a button or buttons and split the images as required using LDImage.SplitImage.
Another approach is to draw the images as you have done and check when a mouse is clicked if it is inside the button. This is fairly simple to achieve, but won't easily give you the MouseOver effect that make a button clearer.
You can create an image in SB code directly, setting each pixel value, see LDImage.GetImagePixels for example. This I would only consider in last resort for dynamic button design that isn't known at compile time - more complex and generally unnecessay.
As a slightly simpler approach you can create an image from a part of the screen, see LDImage.Capture rather than directly from a file (I still recommend using a file) - this requires the image to be visible on screen so may create some flicker as it creates the image.
See WSQS642.000-0 which uses the last method which is closest to what you want I think, but its a bit tricky, but fun as well.
The best way is to create your button images and save or create in a png and load from a file. You can save multiple images for a button or buttons and split the images as required using LDImage.SplitImage.
Another approach is to draw the images as you have done and check when a mouse is clicked if it is inside the button. This is fairly simple to achieve, but won't easily give you the MouseOver effect that make a button clearer.
You can create an image in SB code directly, setting each pixel value, see LDImage.GetImagePixels for example. This I would only consider in last resort for dynamic button design that isn't known at compile time - more complex and generally unnecessay.
As a slightly simpler approach you can create an image from a part of the screen, see LDImage.Capture rather than directly from a file (I still recommend using a file) - this requires the image to be visible on screen so may create some flicker as it creates the image.
See WSQS642.000-0 which uses the last method which is closest to what you want I think, but its a bit tricky, but fun as well.

