41223108 cp2023

  • Home
    • SMap
    • reveal
    • blog
  • About
  • 倉儲維護
    • s.cycu.org維護
    • windows維護
  • weekly progress
    • w1~4
    • w5
    • w6
    • w7
    • w9
    • w12
      • helloworld
      • GD繪圖程式1
    • W13
    • w15
  • ANSIC
    • 1.
    • 2.
    • 3.
    • 4.
    • 5.
    • 6.
    • 7.
    • 8.
    • 9.
    • 10.
  • NOTE
    • ssh
    • puttygen
  • 國旗練習
    • Thai
    • Laos
    • Bangladesh
    • vietnam
    • Italian
    • Russia
    • Belgium
    • Ukraine
    • Korea
  • 課程評分
  • Brython
  • setup
  • C_lib
  • replit
  • MSD
  • Final
Laos << Previous Next >> vietnam

Bangladesh

#include <stdio.h>
#include <gd.h>
#include <math.h>

#define WIDTH 600
#define HEIGHT 400
#define GREEN 0x138808  // Green color
#define RED 0xE30A17     // Red color

void drawBangladeshFlag() {
    gdImagePtr im;
    FILE *output;

    im = gdImageCreateTrueColor(WIDTH, HEIGHT);
    output = fopen("bangladesh_flag.png", "wb");

    // Draw green background
    gdImageFilledRectangle(im, 0, 0, WIDTH - 1, HEIGHT - 1, GREEN);

    // Draw red circle
    int centerX = WIDTH / 2;
    int centerY = HEIGHT / 2;
    int circleRadius = 100;

    gdImageFilledEllipse(im, centerX, centerY, circleRadius * 2, circleRadius * 2, RED);

    gdImagePng(im, output);
    fclose(output);
    gdImageDestroy(im);
}

int main() {
    drawBangladeshFlag();
    return 0;
}


Laos << Previous Next >> vietnam

Copyright © All rights reserved | This template is made with by Colorlib