kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
3aabb09fa3
commit
beb2d0e795
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 117 KiB |
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 1.9 MiB |
|
@ -0,0 +1,24 @@
|
|||
|
||||
def setup():
|
||||
size(640, 360)
|
||||
# The image file must be in the data folder of
|
||||
# the current sketch to load successfully.
|
||||
global img
|
||||
img = loadImage("moonwalk.jpg") # Load the image into the programr
|
||||
|
||||
def draw():
|
||||
background(255, 0, 0)
|
||||
image(img, 0, 0)
|
||||
|
||||
|
||||
def reduce_image(img, factor):
|
||||
rimg = createGraphics(int(img.width * factor), int(img.height * factor))
|
||||
rimg.beginDraw()
|
||||
rimg.image(img, 0, 0, img.width * factor, img.height * factor)
|
||||
rimg.endDraw()
|
||||
return rimg
|
||||
|
||||
def keyPressed():
|
||||
global img
|
||||
if key == 'r':
|
||||
img = reduce_image(img, .9)
|
|
@ -26,6 +26,12 @@ Here are listed some of the tools I have been using:
|
|||
|
||||
---
|
||||
|
||||

|
||||
|
||||
[sketch_2020_11_10reduce_images](https://github.com/villares/sketch-a-day/tree/master/2020/sketch_2020_11_10reduce_images) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
[sketch_2020_11_09arcs_for_pyp5js](https://github.com/villares/sketch-a-day/tree/master/2020/sketch_2020_11_09arcs_for_pyp5js) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
@ -38,7 +44,7 @@ Here are listed some of the tools I have been using:
|
|||
|
||||
---
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
[sketch_2020_11_07](https://github.com/villares/sketch-a-day/tree/master/2020/sketch_2020_11_07) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
|
Ładowanie…
Reference in New Issue