C

Cコードスクリーンショット生成

Cのスニペットを、Macから離れることなく共有したくなる画像に。

C のコードは、メモリやポインタについて正確な指摘をするために投稿されることがほとんどです。つまり一文字たりとも疎かにできません。

Codeshotは貼り付けたコードからCを判別するので、言語の選び間違いは起きません。付属する30種類のうち3つのテーマで同じスニペットを、アプリ自身のスタイルシートで表示しています。

#include <stdlib.h>

typedef struct {
    char *code;
    int scale;
} Snapshot;

int snapshot_export(const Snapshot *s, const char *path) {
    if (s == NULL || path == NULL) return -1;
    return render_and_save(s->code, path, s->scale);
}
GitHub · ダーク
#include <stdlib.h>

typedef struct {
    char *code;
    int scale;
} Snapshot;

int snapshot_export(const Snapshot *s, const char *path) {
    if (s == NULL || path == NULL) return -1;
    return render_and_save(s->code, path, s->scale);
}
Solarized · ダーク
#include <stdlib.h>

typedef struct {
    char *code;
    int scale;
} Snapshot;

int snapshot_export(const Snapshot *s, const char *path) {
    if (s == NULL || path == NULL) return -1;
    return render_and_save(s->code, path, s->scale);
}
Tokyo Night · ダーク

Cに合うテーマ選び

ポインタまわりの記号は小さいサイズだと失われがちです。詰め込むのではなく、フォントを大きくしてコードを削ってください。

サイズを正しく決める

画像サイズを内容に合わせるか、比率で固定します(1:1、4:3、3:2、16:9、9:16、2:3、3:4)。そのうえで1×・2×・3×から選んで書き出せば、Retinaディスプレイでも鮮明なままです。Cでクリップボードに直接コピー、またはSで保存できます。

30種類のテーマを見比べるか、全体の流れをご覧ください。

Cと、ほかの59言語のために

すべてMac上で動作します。コードが外に出ることはありません。

ダウンロード