📄 image.c
字号:
/* * File: image.c * * Copyright (C) 1997 Raph Levien <raph@acm.org> * Copyright (C) 1999 James McCollough <jamesm@gtwn.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *//* * This file implements image data transfer methods. It handles the transfer * of data from an Image to a DwImage widget. */#include <stdio.h>#include <string.h>#include "msg.h"#include "image.h"/* * Local data *///static size_t linebuf_size = 0;//static guchar *linebuf = NULL;/* * Create and initialize a new image structure. */DilloImage * a_Image_new(gint width, gint height, const char *tooltip, const char *alt_text, gint32 bg_color){ DilloImage *Image; Image = g_new(DilloImage, 1); Image->dw = (DwImage *) a_Dw_image_new(DW_IMAGE_RGB, tooltip, alt_text); Image->width = 0; Image->height = 0; Image->bg_color = bg_color; Image->RefCount = 1; return Image;}/* * Deallocate an Image structure */static void Image_free(DilloImage *Image){ g_free(Image);}/* * Unref and free if necessary */void a_Image_unref(DilloImage *Image){ _MSG(" %d ", Image->RefCount); if (Image && --Image->RefCount == 0) Image_free(Image);}/* * Add a reference to an Image struct */void a_Image_ref(DilloImage *Image){ if (Image) ++Image->RefCount;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -