Skip to content
Check out how to use the Graphics functions!

Graphics

Simple Usage Examples

Draw Circle Record

Concentric Ripple Effect with Colored Circles

The following code shows examples of using Draw Circle to demonstrate how to draw a circle on the screen with different colors and radii, with and without using variables.

#include "splashkit.h"
int main()
{
open_window("Draw Circles", 800, 600);
// Create circles with different radii
circle circle1 = circle_at(screen_center(), 50);
circle circle2 = circle_at(screen_center(), 100);
clear_screen();
// Draw the circles with different colors
draw_circle(COLOR_RED, circle1);
draw_circle(COLOR_BLUE, circle2);
draw_circle(COLOR_ORANGE, circle_at(screen_center(), 150));
draw_circle(COLOR_GREEN, circle_at(screen_center(), 200));
refresh_screen();
delay(4000);
close_all_windows();
return 0;
}

Output:

draw_circle_record-1-simple example


Draw Circle On Bitmap

Creating a Red Planet

The following code demonstrates how to use Draw Circle On Bitmap to create a red planet with surface details using multiple circles.

#include "splashkit.h"
int main()
{
// Create a Window and bitmap for the map
window window = open_window("Window", 400, 400);
bitmap planet = create_bitmap("planet", 400, 400);
// Fill background with dark color
clear_bitmap(planet, COLOR_BLACK);
// Create color
color red = COLOR_RED;
// Draw the main planet circle
fill_circle_on_bitmap(planet, rgba_color(180, 0, 0, 255), 200, 200, 150);
draw_circle_on_bitmap(planet, red, 200, 200, 150);
// Add some surface details with smaller circles
for(int i = 0; i < 15; i++)
{
double x = rnd(100, 300); // Random between 100 and 300
double y = rnd(100, 300); // Random between 100 and 300
double size = rnd(10, 30); // Random between 10 and 30
draw_circle_on_bitmap(planet, red, x, y, size);
}
while (!window_close_requested(window))
{
process_events();
// Draw the bitmap to the window
draw_bitmap(planet, 0, 0);
refresh_screen();
}
free_bitmap(planet);
close_all_windows();
return 0;
}

Output:

draw_circle_on_bitmap-1-red-planet example


Fill Circle

Basic Blue Circle

The following code shows examples of using Fill Circle to show how to draw a filled-in blue circle.

#include "splashkit.h"
int main()
{
open_window("Fill Circle", 800, 600);
clear_screen();
fill_circle(COLOR_BLUE, 300, 300, 200);
refresh_screen();
delay(4000);
close_all_windows();
return 0;
}

Output:

fill_circle-1-simple example


Fill Circle On Window

Traffic Lights

The following code shows an example of using Fill Circle On Window to display three circles of different colors and placement in a specified window to look like traffic lights.

#include "splashkit.h"
int main()
{
// Open a new window and initialize to a window variable
window window = open_window("Traffic Lights", 800, 600);
clear_screen(COLOR_WHITE);
// Use function to place 3 circles in destination window as traffic lights
fill_circle_on_window(window, COLOR_RED, 400, 100, 50);
fill_circle_on_window(window, COLOR_YELLOW, 400, 250, 50);
fill_circle_on_window(window, COLOR_GREEN, 400, 400, 50);
refresh_screen();
delay(5000);
// Close all windows
close_all_windows();
}

Output:

fill_circle_on_window-1-simple example


Fill Ellipse

Basic Blue Ellipse

The following code shows examples of using Fill Ellipse to show how to draw a filled-in blue ellipse.

#include "splashkit.h"
int main()
{
open_window("Fill Ellipse", 800, 600);
clear_screen();
fill_ellipse(COLOR_BLUE, 200, 200, 400, 200);
// Added rectangle with same arguments as above for x, y, width and height
draw_rectangle(COLOR_RED, 200, 200, 400, 200);
refresh_screen();
delay(4000);
close_all_windows();
return 0;
}

Output:

fill_ellipse-1-simple example


Clover Drawing

The following code shows an example of using Fill Ellipse with different dimensions to draw a three-leaf clover.

#include "splashkit.h"
int main()
{
open_window("Clover Drawing with Fill Ellipse", 1000, 600);
clear_screen();
fill_ellipse(COLOR_GREEN, 150, 225, 400, 200);
fill_ellipse(COLOR_GREEN, 375, 0, 200, 400);
fill_ellipse(COLOR_GREEN, 400, 225, 400, 200);
fill_rectangle(COLOR_BROWN, 470, 400, 10, 150);
refresh_screen();
delay(4000);
close_all_windows();
return 0;
}

Output:

fill_ellipse-2-extended example


Fill Ellipse On Bitmap

Creating Water Ripples

The following code demonstrates how to use Fill Ellipse On Bitmap to create a water ripple effect using concentric ellipses with varying transparency.

#include "splashkit.h"
int main()
{
// Create a window and bitmap for the water surface
window window = open_window("Window", 400, 300);
bitmap bitmap = create_bitmap("water", 400, 300);
// Fill background with light blue
clear_bitmap(bitmap, rgba_color(200, 230, 255, 255));
// Create different blue tones for ripples (from most opaque to most transparent)
color ripple_colors[] = {
rgba_color(100, 150, 255, 100),
rgba_color(120, 170, 255, 80),
rgba_color(140, 190, 255, 60),
rgba_color(160, 210, 255, 40),
rgba_color(180, 230, 255, 20)
};
// Create ripple effect with concentric ellipses
double center_x = 200; // Center of the bitmap
double center_y = 150;
for(int i = 0; i < 5; i++)
{
// Larger ellipses with decreasing size from center
fill_ellipse_on_bitmap(bitmap, ripple_colors[i],
center_x - (100 + i*30), // x gets further from center
center_y - (75 + i*20), // y gets further from center
200 + i*60, // width increases for outer ripples
150 + i*40); // height increases for outer ripples
}
while (!window_close_requested(window))
{
process_events();
// Draw the bitmap to the window
draw_bitmap(bitmap, 0, 0);
refresh_screen();
}
free_bitmap(bitmap);
close_all_windows();
return 0;
}

Output:

fill_ellipse_on_bitmap-1-water-ripples example


Clear Screen

Background Color

The following code shows an example of using Clear Screen to change the background color to blue.

#include "splashkit.h"
int main()
{
open_window("Blue Background", 800, 600);
//Use Clear Screen to change the background color to blue
clear_screen(COLOR_BLUE);
refresh_screen(60);
delay(4000);
close_all_windows();
return 0;
}

Output:

clear_screen-1-simple example


Refresh Screen

House Drawing

The following code shows examples of using Refresh Screen to show how double buffering works.

#include "splashkit.h"
int main()
{
open_window("House Drawing", 800, 600);
clear_screen(COLOR_WHITE);
refresh_screen();
delay(1000);
fill_ellipse(COLOR_BRIGHT_GREEN, 0, 400, 800, 400);
refresh_screen();
delay(1000);
fill_rectangle(COLOR_GRAY, 300, 300, 200, 200);
refresh_screen();
delay(1000);
fill_triangle(COLOR_RED, 250, 300, 400, 150, 550, 300);
refresh_screen();
delay(5000);
close_all_windows();
return 0;
}

Output:

refresh_screen-1-simple example


Draw Bitmap Named

Basic Bitmap Drawing

The following code shows an example of using Draw Bitmap to display a Bitmap image of the SplashKit logo in a graphics Window.

#include "splashkit.h"
int main()
{
// Open Window
open_window("Basic Bitmap Drawing", 315, 330);
// Load bitmap image
load_bitmap("skbox", "skbox.png");
while (!quit_requested())
{
process_events();
clear_screen(rgb_color(67, 80, 175));
draw_bitmap("skbox", 50, 50); // draw bitmap image
refresh_screen();
}
close_all_windows();
free_all_bitmaps();
return 0;
}

Output:

draw_bitmap_named-1-simple example


Hello World! This is SplashKit!

The following code shows a fun example of using Draw Bitmap to create a fun animation/video. This example was created by someone that grew up as a “horse girl” and is reminded of the Saddle Club intro theme song (played in this example) every time she creates a new “hello world” program.

Originally created for the programmers.guide website.

#include "splashkit.h"
int main()
{
// Download resources
download_sound_effect("Hello World", "https://programmers.guide/resources/code-examples/part-0/hello-world-snippet-saddle-club.ogg", 443);
download_font("main", "https://programmers.guide/resources/code-examples/part-0/Roboto-Italic.ttf", 443);
download_bitmap("Earth", "https://programmers.guide/resources/code-examples/part-0/earth.png", 443);
download_bitmap("SmallEarth", "https://programmers.guide/resources/code-examples/part-0/earth-small.png", 443);
download_bitmap("SplashKitBox", "https://programmers.guide/resources/code-examples/part-0/skbox.png", 443);
open_window("Hello World: Using Resources with SplashKit", 800, 600);
play_sound_effect("Hello World");
clear_screen(COLOR_WHITE);
draw_text("Anyone remember the \"Hello World\" Saddle Club song?", COLOR_BLACK, "main", 30, 40, 200);
refresh_screen();
delay(2500);
clear_screen(COLOR_WHITE);
// H
draw_bitmap("SmallEarth", 20, 100);
draw_bitmap("SmallEarth", 20, 130);
draw_bitmap("SmallEarth", 20, 160);
draw_bitmap("SmallEarth", 20, 190);
draw_bitmap("SmallEarth", 20, 220);
draw_bitmap("SmallEarth", 52, 160);
draw_bitmap("SmallEarth", 84, 100);
draw_bitmap("SmallEarth", 84, 130);
draw_bitmap("SmallEarth", 84, 160);
draw_bitmap("SmallEarth", 84, 190);
draw_bitmap("SmallEarth", 84, 220);
refresh_screen();
delay(200);
// E
draw_bitmap("SmallEarth", 148, 100);
draw_bitmap("SmallEarth", 148, 130);
draw_bitmap("SmallEarth", 148, 160);
draw_bitmap("SmallEarth", 148, 190);
draw_bitmap("SmallEarth", 148, 220);
draw_bitmap("SmallEarth", 180, 100);
draw_bitmap("SmallEarth", 212, 100);
draw_bitmap("SmallEarth", 180, 160);
draw_bitmap("SmallEarth", 180, 220);
draw_bitmap("SmallEarth", 212, 220);
refresh_screen();
delay(200);
// L
draw_bitmap("SmallEarth", 276, 100);
draw_bitmap("SmallEarth", 276, 130);
draw_bitmap("SmallEarth", 276, 160);
draw_bitmap("SmallEarth", 276, 190);
draw_bitmap("SmallEarth", 276, 220);
draw_bitmap("SmallEarth", 308, 220);
draw_bitmap("SmallEarth", 340, 220);
refresh_screen();
delay(200);
// L
draw_bitmap("SmallEarth", 404, 100);
draw_bitmap("SmallEarth", 404, 130);
draw_bitmap("SmallEarth", 404, 160);
draw_bitmap("SmallEarth", 404, 190);
draw_bitmap("SmallEarth", 404, 220);
draw_bitmap("SmallEarth", 436, 220);
draw_bitmap("SmallEarth", 468, 220);
refresh_screen();
delay(200);
// O
draw_bitmap("SmallEarth", 530, 160);
draw_bitmap("SmallEarth", 622, 160);
draw_bitmap("SmallEarth", 540, 128);
draw_bitmap("SmallEarth", 560, 100);
draw_bitmap("SmallEarth", 592, 100);
draw_bitmap("SmallEarth", 612, 128);
draw_bitmap("SmallEarth", 540, 192);
draw_bitmap("SmallEarth", 560, 220);
draw_bitmap("SmallEarth", 592, 220);
draw_bitmap("SmallEarth", 612, 192);
refresh_screen();
delay(500);
// World
draw_bitmap("Earth", 100, 350);
refresh_screen();
delay(2000);
// SplashKit ("Me")
draw_bitmap("SplashKitBox", 450, 300);
draw_text("SplashKit!", COLOR_BLACK, "main", 50, 450, 530);
refresh_screen();
delay(2000);
close_all_windows();
return 0;
}

Output:


Draw Line

Colourful Starburst

The following code shows examples of using Draw Line to draw a colourful starburst pattern on the screen.

#include "splashkit.h"
int main()
{
open_window("Colourful Starburst", 600, 600);
clear_screen(COLOR_BLACK);
// Draws starburst pattern with changing colours to window
draw_line(COLOR_YELLOW, 0, 0, 600, 600);
draw_line(COLOR_GREEN, 0, 150, 600, 450);
draw_line(COLOR_TEAL, 0, 300, 600, 300);
draw_line(COLOR_BLUE, 0, 450, 600, 150);
draw_line(COLOR_VIOLET, 0, 600, 600, 0);
draw_line(COLOR_PURPLE, 150, 0, 450, 600);
draw_line(COLOR_PINK, 300, 0, 300, 600);
draw_line(COLOR_RED, 450, 0, 150, 600);
draw_line(COLOR_ORANGE, 600, 0, 0, 600);
refresh_screen();
delay(5000);
close_all_windows();
return 0;
}

Output:

draw_line-1-simple example


Draw Line On Bitmap

Drawing a Route on a Map

The following code demonstrates how to use Draw Line On Bitmap to create a simple route between two points on a map.

#include "splashkit.h"
int main()
{
// Create a Window and bitmap for the map
window window = open_window("Window", 400, 300);
bitmap bitmap = create_bitmap("map", 400, 300);
// Fill background with white
clear_bitmap(bitmap, COLOR_WHITE);
// Draw the route line and points
draw_line_on_bitmap(bitmap, COLOR_GREEN,
100, 80, // Starting point (x1, y1)
300, 220); // End point (x2, y2)
fill_circle_on_bitmap(bitmap, COLOR_RED, 100, 80, 5); // Start point
fill_circle_on_bitmap(bitmap, COLOR_RED, 300, 220, 5); // End point
while (!window_close_requested(window))
{
process_events();
// Draw the bitmap to the current window
draw_bitmap(bitmap, 0, 0);
refresh_screen();
}
free_bitmap(bitmap);
close_all_windows();
return 0;
}

Output:

draw_line_on_bitmap-1-map-route example


Draw Line On Window

Basic Line Drawing

The following code shows examples of using Draw Line On Window to draw a colourful starburst pattern on a specific window.

#include "splashkit.h"
int main()
{
// Create Window
window window = open_window("Colourful Starburst", 600, 600);
clear_screen(COLOR_BLACK);
// Draws starburst pattern with changing colours to specific window
draw_line_on_window(window, COLOR_YELLOW, 0, 0, 600, 600);
draw_line_on_window(window, COLOR_GREEN, 0, 150, 600, 450);
draw_line_on_window(window, COLOR_TEAL, 0, 300, 600, 300);
draw_line_on_window(window, COLOR_BLUE, 0, 450, 600, 150);
draw_line_on_window(window, COLOR_VIOLET, 0, 600, 600, 0);
draw_line_on_window(window, COLOR_PURPLE, 150, 0, 450, 600);
draw_line_on_window(window, COLOR_PINK, 300, 0, 300, 600);
draw_line_on_window(window, COLOR_RED, 450, 0, 150, 600);
draw_line_on_window(window, COLOR_ORANGE, 600, 0, 0, 600);
refresh_screen();
delay(5000);
close_all_windows();
return 0;
}

Output:

draw_line_on_window-1-simple example


Draw Quad

Ninja Star

The following code shows examples of using Draw Quad to show how to draw a 4 sided shape. This example aranges for diamond style shapes into a ninja star pattern.

#include "splashkit.h"
int main()
{
// Create 4 diamond shapes using quads
quad q1 = quad_from(400, 200, 300, 300, 300, 0, 200, 200);
quad q2 = quad_from(400, 210, 310, 300, 600, 300, 400, 390);
quad q3 = quad_from(200, 400, 300, 300, 300, 600, 400, 400);
quad q4 = quad_from(200, 390, 290, 300, 0, 300, 200, 210);
open_window("Ninja Star", 600, 600);
clear_screen(COLOR_WHITE);
// Draw the quads
draw_quad(COLOR_BLACK, q1);
draw_quad(COLOR_GREEN, q2);
draw_quad(COLOR_RED, q3);
draw_quad(COLOR_BLUE, q4);
refresh_screen();
delay(5000);
close_all_windows();
return 0;
}

Output:

draw_quad-1-simple example


Draw Quad On Window

Halved Ninja Star

The following code shows examples of using Draw Quad On Window to show how to draw a 4 sided shape to a specific window. The example extends this Draw Quad usage example to split it across 2 separate windows.

#include "splashkit.h"
int main()
{
// Create diamond shaped quads
quad q1 = quad_from(400, 200, 300, 300, 300, 0, 200, 200);
quad q2 = quad_from(400, 210, 310, 300, 600, 300, 400, 390);
quad q3 = quad_from(200, 400, 300, 300, 300, 600, 400, 400);
quad q4 = quad_from(200, 390, 290, 300, 0, 300, 200, 210);
// Create two windows
window window_1 = open_window("Diamonds On Window 1", 600, 600);
window window_2 = open_window("Diamonds On Window 2", 600, 600);
// Move windows to see both side by side
move_window_to(window_1, 0, 0);
move_window_to(window_2, window_width(window_1), 0);
clear_screen(COLOR_WHITE);
// Draw the first and second quad on first window
draw_quad_on_window(window_1, COLOR_BLACK, q1);
draw_quad_on_window(window_1, COLOR_GREEN, q2);
// Draw the third and fourth quad on second window
draw_quad_on_window(window_2, COLOR_RED, q3);
draw_quad_on_window(window_2, COLOR_BLUE, q4);
refresh_screen();
delay(5000);
close_all_windows();
return 0;
}

Output:

draw_quad_on_window-1-simple example


Fill Quad

Coloured Star

The following code shows examples of using Fill Quad to show how to draw filled-in 4 sided diamond shapes. This example shows a coloured in version of this Draw Quad usage example.

#include "splashkit.h"
int main()
{
// Create 4 diamond shapes using quads
quad q1 = quad_from(400, 200, 300, 300, 300, 0, 200, 200);
quad q2 = quad_from(400, 210, 310, 300, 600, 300, 400, 390);
quad q3 = quad_from(200, 400, 300, 300, 300, 600, 400, 400);
quad q4 = quad_from(200, 390, 290, 300, 0, 300, 200, 210);
open_window("Coloured Star", 600, 600);
clear_screen(COLOR_WHITE);
// Draw filled-in quads
fill_quad(COLOR_BLACK, q1);
fill_quad(COLOR_GREEN, q2);
fill_quad(COLOR_RED, q3);
fill_quad(COLOR_BLUE, q4);
refresh_screen();
delay(5000);
close_all_windows();
return 0;
}

Output:

fill_quad-1-simple example


Fill Quad On Bitmap

The following code demonstrates how to use Fill Quad On Bitmap to create the windows logo using four quads to represent the window panels.

#include "splashkit.h"
int main()
{
// Create a window and bitmap for the window
window window = open_window("Windows Logo", 400, 300);
bitmap bitmap = create_bitmap("Windows Logo Bitmap", 400, 300);
// Fill background with windows blue
clear_bitmap(bitmap, rgba_color(51, 118, 212, 255));
// Draw the four Window panels
quad panels[] = {
quad_from(
85, 50,
180, 41,
85, 130,
180, 130
),
quad_from(
193, 40,
323, 26,
193, 130,
323, 130
),
quad_from(
85, 143,
180, 143,
85, 222,
180, 233
),
quad_from(
193, 143,
323, 143,
193, 235,
323, 250
)
};
// Draw each panel
for (int i = 0; i < 4; i++)
{
fill_quad_on_bitmap(bitmap, COLOR_WHITE, panels[i]);
}
while (!window_close_requested(window))
{
process_events();
// Draw the bitmap to the window
draw_bitmap(bitmap, 0, 0);
// Refresh the window
refresh_screen();
}
free_bitmap(bitmap);
return 0;
}

Output:

fill_quad_on_bitmap-1-windows-logo example


Fill Quad On Window

Halved Coloured Star

The following code shows examples of using Fill Quad On Window to show how to draw filled-in 4 sided diamond shapes to a specific window. This example shows a filled in version of this Draw Quad On Window usage example.

#include "splashkit.h"
int main()
{
// Create diamond shaped quads
quad q1 = quad_from(400, 200, 300, 300, 300, 0, 200, 200);
quad q2 = quad_from(400, 210, 310, 300, 600, 300, 400, 390);
quad q3 = quad_from(200, 400, 300, 300, 300, 600, 400, 400);
quad q4 = quad_from(200, 390, 290, 300, 0, 300, 200, 210);
// Create two Windows
window window1 = open_window("Filled Diamond On Window 1", 600, 600);
window window2 = open_window("Filled Diamond On Window 2", 600, 600);
// Move windows to see both side by side
move_window_to(window1, 0, 0);
move_window_to(window2, window_width(window1), 0);
clear_screen(COLOR_WHITE);
// Draw the first and second quad on first window
fill_quad_on_window(window1, COLOR_BLACK, q1);
fill_quad_on_window(window1, COLOR_GREEN, q2);
// Draw the third and fourth quad on second window
fill_quad_on_window(window2, COLOR_RED, q3);
fill_quad_on_window(window2, COLOR_BLUE, q4);
refresh_screen();
delay(5000);
close_all_windows();
return 0;
}

Output:

fill_quad_on_window-1-simple example


Fill Rectangle

Basic Blue Rectangle

The following code shows examples of using Fill Rectangle to show how to draw a filled-in blue rectangle.

#include "splashkit.h"
int main()
{
open_window("Fill rectangle", 800, 600);
clear_screen();
fill_rectangle(COLOR_BLUE, 200, 200, 200, 100);
refresh_screen();
delay(4000);
close_all_windows();
return 0;
}

Output:

fill_rectangle-1-simple example


Draw Triangle On Bitmap

Creating a Mountain Peak

The following code demonstrates how to use Draw Triangle On Bitmap to create a simple mountain peak outline against a sky background.

#include "splashkit.h"
int main()
{
// Create a window and bitmap for the mountain scene
window window = open_window("Window", 400, 300);
bitmap bitmap = create_bitmap("mountain", 400, 300);
// Fill background with light blue color
clear_bitmap(bitmap, COLOR_LIGHT_BLUE);
// Draw right peak (smallest)
draw_triangle_on_bitmap(bitmap, COLOR_GRAY,
175, 250, // Left base
275, 175, // Peak
375, 250); // Right base
// Draw left peak (medium)
draw_triangle_on_bitmap(bitmap, COLOR_GRAY,
25, 250, // Left base
125, 125, // Peak
225, 250); // Right base
// Draw center peak (tallest)
draw_triangle_on_bitmap(bitmap, COLOR_GRAY,
100, 250, // Left base
200, 100, // Peak
300, 250); // Right base
while (!window_close_requested(window))
{
process_events();
// Draw the bitmap to the window
draw_bitmap(bitmap, 0, 0);
refresh_screen();
}
free_bitmap(bitmap);
close_all_windows();
return 0;
}

Output:

draw_triangle_on_bitmap-1-mountain-peak example


Fill Triangle

Basic Red Triangle

The following code demonstrates how to use the Fill Triangle function to draw a simple red-colored filled triangle. It creates a triangle with specified coordinates and fills it with red color.

#include "splashkit.h"
int main()
{
open_window("Fill Triangle Example", 800, 600);
clear_screen();
fill_triangle(COLOR_RED, 100, 100, 200, 200, 300, 100);
refresh_screen();
delay(5000);
close_all_windows();
return 0;
}

Output:

fill_triangle-1-simple example


Fill Triangle On Bitmap

Hooray! A Red Hat

The following code shows an example of using the Fill Triangle On Bitmap function to draw a red triangle on a loaded bitmap.

#include "splashkit.h"
int main()
{
// Open a window
open_window("Happy Hat", 618, 618);
// Load the bitmaps for sad and smiling emojis (https://openmoji.org/library/#group=smileys-emotion)
bitmap sad_emoji = load_bitmap("sad_emoji", "sad_emoji.png");
bitmap smiling_emoji = load_bitmap("smiling_emoji", "smiling_emoji.png");
// Draw the sad emoji and add a hat
clear_screen(COLOR_BLACK);
draw_bitmap(sad_emoji, 0, 0);
refresh_screen();
delay(1000);
// Draw a triangle hat on the smiling emoji
fill_triangle_on_bitmap(smiling_emoji, COLOR_RED, 100, 200, 309, 20, 520, 200);
// Clear screen and switch to the smiling emoji
clear_screen(COLOR_BLACK);
draw_bitmap(smiling_emoji, 0, 0);
refresh_screen();
delay(1000);
// Spin the smiling emoji with the hat
for (int i = 0; i < 360; i++)
{
clear_screen(COLOR_BLACK);
draw_bitmap(smiling_emoji, 0, 0, option_rotate_bmp(i));
refresh_screen();
delay(10);
}
// Free the bitmap resource
free_all_bitmaps();
// Close all windows
close_all_windows();
return 0;
}

Output:

fill_triangle_on_bitmap-1-simple example