12-16-2022, 09:24 PM
(This post was last modified: 12-16-2022, 09:25 PM by James D Jarvis.)
The world's worst image painter. I wish I'd kept track of the whole session. There was also a last second edit because I can't explain everything to the chat AI. It's probably a good thing it can't hear me curse.
Code: (Select All)
Dim image As _Unsigned Long
Dim s As _Unsigned Long
s = _NewImage(800, 600, 32)
Screen s
' Prompt the user to enter the width and height of the image
Print "Enter the width of the image: ";
Input ww
Print "Enter the height of the image: ";
Input hh
' Create a blank image with the specified dimensions
image = _NewImage(ww, hh)
' Set the initial color of the image to white
_Dest image
For x = 0 To width - 1
For y = 0 To height - 1
PSet (x, y), _RGB32(255, 255, 255)
Next y
Next x
' Display the image on the screen
Cls
_PutImage (0, 0), image, 0
Sleep 1
' Loop until the user exits the program
Do
_Dest s
' Prompt the user to enter the x and y coordinates of the pixel they want to change
Print "Enter the x coordinate of the pixel to change: ";
Input x
Print "Enter the y coordinate of the pixel to change: ";
Input y
' Prompt the user to enter the new color for the pixel
Print "Enter the red value (0-255): ";
Input red
Print "Enter the green value (0-255): ";
Input green
Print "Enter the blue value (0-255): ";
Input blue
' Update the color of the pixel
_Dest image
PSet (x, y), _RGB32(red, green, blue)
_Dest 0
' Redraw the image on the screen
_PutImage (0, 0), image, s
' Prompt the user to enter 'q' to exit or any other key to continue
Print "Press 'q' to quit or any other key to continue: ";
Input kkey$
Loop Until kkey$ = "q"