小编Jér*_*eau的帖子

如何在 C 中创建位图并使用 gcc 进行编译

我决定学习 C,我尝试遵循本教程http://ricardovelace.com/creating-bitmap-images-with-c-on-windows.html

但是当我尝试使用 gcc 编译我的代码时 >gcc -Wall testc o app

他不知道 type_rgb,我可以定义这个类型吗?如何定义?我的代码在哪里?

#include <stdio.h>


struct rgb_data {
  float r, g, b;
};

void save_bitmap( const char *file_name, int width, int height, int dpi, type_rgb  *pixel_data); 
/*
 next steps of the tutorial
*/

rgb_data *pixels = new rgb_data[width * height];

for( int x = 0; x < width; x++)
  {
    for(int y = 0; y < height; y++)
        int a = y * width +x; 
          {

            if ((x > 50 …
Run Code Online (Sandbox Code Playgroud)

c gcc bitmap

2
推荐指数
1
解决办法
6667
查看次数

标签 统计

bitmap ×1

c ×1

gcc ×1