Lab 7: PaintPot

Description

This is the seventh lab that ive done so far and in this lab we start another lab thats based on appventor this is our second lab thats based on this program and what we will be doing in this lab will be much more different than the previous hello purr lab in this lab theres more depth and more blocks and event handlers we have to focus on and if we dont follow the instructions step by step then you will get lost literally. This lab is called paintpot we will be again putton in now various buttons and also the drawingcanvas and the camera button to use this in this lab these are requirements for the lab. As you can see we will be using again the red, blue, and green colors for this lab now with these colors and using different functions in this section of appventor by the end of this lab in our emulator or phone we will be painting the image we have to either red, blue or green and we can use buttons like big dots small dots and wipe to paint the image!

 

Code

The way this program works is like this in the blocks editor you will drag the canvas.touched block to the editor then you will go on my definition select name x,y and put it into the block, after that you put in the drawcircle block to the canvas touched block, in the draw circle block you put the value x,y into it with the global dot size block too its required but in order for global dot size to come up you need to make a dotsize variable first. After that now you put dragged block from canvas, next you need to put the drawline function into the block placing the values x and y and current x and y.. these values all are required to do when youre doing this. Now we shift to the middle put in the red green and blue button.click blocks into the editor and in each block you put in the set paintcolor block into the click block after you do this you go to color select the color of the block and drag it there. next you need to bring three def blocks whichs are small, large and dotsize block too right then is when you put the afterpicture block with the name image block next to it and then you put set backgroundimage to it putting the value image. Next you do the wipe big small and take picture buttons.. For wipe you put call clear to make it function for big and small button you set the global dot size to its actual size. Finally in the take picture button you put in the take picture button.

main=appinventor.ai_pineroskevin.paintpt.Screen1
name=paintpt
assets=../assets
source=../src
build=../build
versioncode=1
versionname=1.0
useslocation=False
#|
$JSON
{"YaVersion":"75","Source":"Form","Properties":{"$Name":"Screen1","$Type":"Form","$Version":"10","Uuid":"0","Title":"Screen1","$Components":[{"$Name":"HorizontalArrangement1","$Type":"HorizontalArrangement","$Version":"2","Uuid":"-1680450450","Width":"-2","Height":"-2","$Components":[{"$Name":"RedButton","$Type":"Button","$Version":"5","Uuid":"1714225931","BackgroundColor":"&HFFFF0000","Text":"Red"},{"$Name":"BlueButton","$Type":"Button","$Version":"5","Uuid":"-1178803432","BackgroundColor":"&HFF0000FF","Text":"Blue"},{"$Name":"GreenButton","$Type":"Button","$Version":"5","Uuid":"706987517","BackgroundColor":"&HFF00FF00","Text":"Green"}]},{"$Name":"DrawingCanvas1","$Type":"Canvas","$Version":"7","Uuid":"-2091706462","BackgroundImage":"kitty.png","LineWidth":"14.0","PaintColor":"&HFFFF0000","Width":"-2","Height":"-2"},{"$Name":"HorizontalArrangement2","$Type":"HorizontalArrangement","$Version":"2","Uuid":"-880893132","$Components":[{"$Name":"TakePictureButton","$Type":"Button","$Version":"5","Uuid":"917317490","Text":"TakePicture"},{"$Name":"WipeButton","$Type":"Button","$Version":"5","Uuid":"2096648735","Text":"Wipe"},{"$Name":"BigButton","$Type":"Button","$Version":"5","Uuid":"-1510052914","Text":"BigDots"},{"$Name":"SmallButton","$Type":"Button","$Version":"5","Uuid":"723975416","Text":"SmallDots"}]},{"$Name":"Camera1","$Type":"Camera","$Version":"1","Uuid":"662509985"}]}}
|#

Screenshot

For the screenshots there are two first of all, the one in the left is the screen editor that was used for this lab of paintpot and in the right screenshot is the blocks editor screen where i organized and set the values for each block to make it function properly. Below this explanation i will show you my final editing and my result of this lab of paint pot using appventor and that concludes the end of this lab but also i downloaded the program to my android device so i could just test my lab using my device without going on appventor.

lab7lab7 2

Leave a Reply

Your email address will not be published. Required fields are marked *