Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
9
Task/Bitmap/Processing/bitmap
Normal file
9
Task/Bitmap/Processing/bitmap
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
PGraphics bitmap = createGraphics(100,100); // Create the bitmap
|
||||
bitmap.beginDraw();
|
||||
bitmap.background(255, 0, 0); // Fill bitmap with red rgb color
|
||||
bitmap.endDraw();
|
||||
image(bitmap, 0, 0); // Place bitmap on screen.
|
||||
color b = color(0, 0, 255); // Define a blue rgb color
|
||||
set(50, 50, b); // Set blue colored pixel in the middle of the screen
|
||||
color c = get(50, 50); // Get the color of same pixel
|
||||
if(b == c) print("Color changed correctly"); // Verify
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
/*REXX program demonstrates how to process/display a simple RGB raster graphics image.*/
|
||||
red = '00000000 00000000 11111111'b /*define a red value. */
|
||||
blue = '11111111 00000000 00000000'b /* " " blue " */
|
||||
blue = 'ff 00 00'x /*another way to define a blue value.*/
|
||||
red = 'ff 00 00'x /*a method to define a red value. */
|
||||
blue = '00 00 ff'x /*" " " " " blue " */
|
||||
@. = /*define entire @. array to nulls. */
|
||||
x=10; y=40 /*set pixel's coördinates. */
|
||||
outFN = 'image' /*the filename of the output image PPM */
|
||||
sWidth = 500; sHeight= 500 /*the screen width and height in pixels*/
|
||||
call RGBfill red /*set the entire image to red. */
|
||||
x= 10; y= 40 /*set pixel's coördinates. */
|
||||
call RGBset x, y, blue /*set a pixel (at 10,40) to blue. */
|
||||
color = RGBget(x, y) /*get the color of a pixel. */
|
||||
hexV = c2x(color) /*get hex value of pixel's color. */
|
||||
|
|
@ -17,9 +18,9 @@ say xy ' pixel in binary: ' bin3V /*show again, but with spaces.
|
|||
say /*show a blank between binary and hex. */
|
||||
say xy ' pixel in hex: ' hexV /*show again, but in hexadecimal. */
|
||||
say xy ' pixel in hex: ' hex3V /*show again, but with spaces. */
|
||||
call PPMwrite 'image', 500, 500 /*create a PPM (output) file of image. */ /* ◄■■■■■■■■ not part of this task.*/
|
||||
call PPMwrite outFN, sWidth, sHeight /*create a PPM (output) file of image. */ /* ◄■■■■■■■■ not part of this task.*/
|
||||
say /*show a blank. */
|
||||
say 'The file image.PPM was created.' /*inform user that a file was created. */
|
||||
say 'The file ' outFN".PPM was created." /*inform user that a file was created. */
|
||||
exit /*stick a fork in it, we're all done. */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
RGBfill: @.=arg(1); return /*fill image with a color.*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue