亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? drawtext.c

?? miniucgui1.30版本的源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** $Id: drawtext.c,v 1.30 2003/09/04 06:02:53 weiym Exp $** ** drawtext.c: Low level text drawing.** ** Copyright (C) 2003 Feynman Software.** Copyright (C) 1999 ~ 2002 WEI Yongming.**** Current maintainer: WEI Yongming.**** Create date: 2000/06/15*//*** 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 program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*//*** TODO:*/#include <stdio.h>#include <stdlib.h>#include "common.h"#include "minigui.h"#include "gdi.h"#include "window.h"#include "cliprect.h"#include "gal.h"#include "internals.h"#include "ctrlclass.h"#include "dc.h"#include "pixel_ops.h"#include "cursor.h"#include "drawtext.h"static BITMAP char_bmp;static size_t char_bits_size;BOOL InitTextBitmapBuffer (void){    return TRUE;}void TermTextBitmapBuffer (void){    free (char_bmp.bmBits);    char_bmp.bmBits = NULL;    char_bits_size = 0;}static void prepare_bitmap (PDC pdc, int w, int h){    Uint32 size = GAL_GetBoxSize (pdc->surface, w, h, &char_bmp.bmPitch);    char_bmp.bmType = BMP_TYPE_NORMAL;    char_bmp.bmBitsPerPixel = pdc->surface->format->BitsPerPixel;    char_bmp.bmBytesPerPixel = pdc->surface->format->BytesPerPixel;    char_bmp.bmWidth = w;    char_bmp.bmHeight = h;    if (size <= char_bits_size)        return;    char_bits_size = ((size + 31) >> 5) << 5;    char_bmp.bmBits = realloc (char_bmp.bmBits, char_bits_size);}void gdi_start_new_line (LOGFONT* log_font){    DEVFONT* sbc_devfont = log_font->sbc_devfont;    DEVFONT* mbc_devfont = log_font->mbc_devfont;    if (mbc_devfont) {        if (mbc_devfont->font_ops->start_str_output)            (*mbc_devfont->font_ops->start_str_output) (log_font, mbc_devfont);    }    if (sbc_devfont->font_ops->start_str_output)            (*sbc_devfont->font_ops->start_str_output) (log_font, sbc_devfont);}inline static int get_light (int fg, int bg){    return bg + (fg - bg) / 4;}inline static int get_medium (int fg, int bg){    return bg + (fg - bg) * 2 / 4;}inline static int get_dark (int fg, int bg){    return bg + (fg - bg) * 3 / 4;}static void expand_char_pixmap (PDC pdc, int w, int h, const BYTE* bits,             BYTE* expanded, int bold, int italic, int cols){    GAL_Color pal [5];    gal_pixel pixel [5];    int i, x, y;    int b = 0;    BYTE* line;    GAL_GetRGB (pdc->bkcolor, pdc->surface->format, &pal->r, &pal->g, &pal->b);    GAL_GetRGB (pdc->textcolor, pdc->surface->format, &pal[4].r, &pal[4].g, &pal[4].b);    pal [1].r = get_light  (pal [4].r, pal [0].r);    pal [1].g = get_light  (pal [4].g, pal [0].g);    pal [1].b = get_light  (pal [4].b, pal [0].b);    pal [2].r = get_medium (pal [4].r, pal [0].r);    pal [2].g = get_medium (pal [4].g, pal [0].g);    pal [2].b = get_medium (pal [4].b, pal [0].b);    pal [3].r = get_dark  (pal [4].r, pal [0].r);    pal [3].g = get_dark  (pal [4].g, pal [0].g);    pal [3].b = get_dark  (pal [4].b, pal [0].b);    for (i = 0; i < 5; i++) {        pixel [i] = GAL_MapRGB (pdc->surface->format, pal[i].r, pal[i].g, pal[i].b);    }    line = expanded;    switch (GAL_BytesPerPixel (pdc->surface)) {    case 1:        for (y = 0; y < h; y++) {            expanded = line;            for (x = 0; x < (w + bold + italic); x++) {                *(expanded + x) = pixel [0];            }            if (italic)                expanded += (h - y) >> 1;            for (x = 0; x < w; x++) {                b = *(bits+x);                if (b == 255) b = 4;                else if (b >= 128) b = 3;                else if (b >= 64) b = 2;                else if (b >= 32) b = 1;                else if (b >= 0) b = 0;                *expanded = pixel [b];                if (bold)                    *(expanded + 1) = pixel [b];                expanded++;            }            bits += cols;            line += char_bmp.bmPitch;        }    break;    case 2:        for (y = 0; y < h; y++) {            expanded = line;            for (x = 0; x < (w + bold + italic) << 1; x += 2) {                *(ushort *) (expanded + x) = pixel [0];            }            if (italic)                expanded += ((h - y) >> 1) << 1;            for (x = 0; x < w; x++) {                b = *(bits+x);                if (b == 255) b = 4;                else if (b >= 128) b = 3;                else if (b >= 64) b = 2;                else if (b >= 32) b = 1;                else if (b >= 0) b = 0;                *(ushort *) expanded = pixel [b];                if (bold)                    *(ushort *)(expanded + 2) = pixel [b];                expanded += 2;            }            bits += cols;            line += char_bmp.bmPitch;        }    break;    case 3:        for (y = 0; y < h; y++) {            expanded = line;            for (x = 0; x < (w + bold + italic) * 3; x += 3) {                *(ushort *) (expanded + x) = pixel [0];                *(expanded + x + 2) = pixel [0] >> 16;            }            if (italic)                expanded += 3 * ((h - y) >> 1);            for (x = 0; x < w; x++) {                b = *(bits+x);                if (b == 255) b = 4;                else if (b >= 128) b = 3;                else if (b >= 64) b = 2;                else if (b >= 32) b = 1;                else if (b >= 0) b = 0;                *(ushort *) expanded = pixel[b];                *(expanded + 2) = pixel[b] >> 16;                if (bold) {                    *(ushort *)(expanded + 3) = pixel[b];                    *(expanded + 5) = pixel[b] >> 16;                }                                expanded += 3;            }            bits += cols;            line += char_bmp.bmPitch;        }    break;    case 4:        for (y = 0; y < h; y++) {            expanded = line;            for (x = 0; x < (w + bold + italic) << 2; x += 4) {                *(uint *) (expanded + x)= pixel [0];            }            if (italic)                expanded += ((h - y) >> 1) << 2;            for (x = 0; x < w; x++) {                b = *bits++;                if (b == 255) b = 4;                else if (b >= 128) b = 3;                else if (b >= 64) b = 2;                else if (b >= 32) b = 1;                else if (b >= 0) b = 0;                *(uint *) expanded = pixel[b];                if (bold)                    *(uint *) (expanded + 4) = pixel[b];                expanded += 4;            }            line += char_bmp.bmPitch;        }    }}static void expand_char_bitmap (int w, int h,             const BYTE* bits, int bpp, BYTE* expanded,             int bg, int fg, int bold, int italic){    int x, y;    int b = 0;    BYTE* line;    line = expanded;    switch (bpp) {    case 1:        for (y = 0; y < h; y++) {            expanded = line;            for (x = 0; x < (w + bold + italic); x++) {                *(expanded + x) = bg;            }            if (italic)                expanded += (h - y) >> 1;            for (x = 0; x < w; x++) {                if (x % 8 == 0)                    b = *bits++;                if ((b & (128 >> (x % 8)))) {                    *expanded = fg;                    if (bold)                        *(expanded + 1) = fg;                }                expanded++;            }            line += char_bmp.bmPitch;        }    break;    case 2:        for (y = 0; y < h; y++) {            expanded = line;            for (x = 0; x < (w + bold + italic) << 1; x += 2) {                *(ushort *) (expanded + x) = bg;            }            if (italic)                expanded += ((h - y) >> 1) << 1;            for (x = 0; x < w; x++) {                if (x % 8 == 0)                    b = *bits++;                if ((b & (128 >> (x % 8)))) {                    *(ushort *) expanded = fg;                    if (bold)                        *(ushort *)(expanded + 2) = fg;                }                expanded += 2;            }            line += char_bmp.bmPitch;        }    break;    case 3:        for (y = 0; y < h; y++) {            expanded = line;            for (x = 0; x < (w + bold + italic) * 3; x += 3) {                *(ushort *) (expanded + x) = bg;                *(expanded + x + 2) = bg >> 16;            }            if (italic)                expanded += 3 * ((h - y) >> 1);            for (x = 0; x < w; x++) {                if (x % 8 == 0)                    b = *bits++;                if ((b & (128 >> (x % 8)))) {                    *(ushort *) expanded = fg;                    *(expanded + 2) = fg >> 16;                    if (bold) {                        *(ushort *)(expanded + 3) = fg;                        *(expanded + 5) = fg >> 16;                    }                }                                expanded += 3;            }            line += char_bmp.bmPitch;        }    break;    case 4:        for (y = 0; y < h; y++) {            expanded = line;            for (x = 0; x < (w + bold + italic) << 2; x += 4) {                *(uint *) (expanded + x)= bg;            }            if (italic)                expanded += ((h - y) >> 1) << 2;            for (x = 0; x < w; x++) {                if (x % 8 == 0)                    b = *bits++;                if ((b & (128 >> (x % 8)))) {                    *(uint *) expanded = fg;                    if (bold)                        *(uint *) (expanded + 4) = fg;                }                expanded += 4;            }            line += char_bmp.bmPitch;        }    }}/* return width of output */static void put_one_char (PDC pdc, LOGFONT* logfont, DEVFONT* devfont,                int* px, int* py, int h, int ascent, const char* mchar, int len){    const BYTE* bits;    int bbox_x = *px, bbox_y = *py;    int bbox_w, bbox_h, bold = 0, italic = 0;    int bpp, pitch = 0;    int old_x, old_y;    GAL_Rect fg_rect, bg_rect;    RECT rcOutput, rcTemp;        if (devfont->font_ops->get_char_bbox) {        (*devfont->font_ops->get_char_bbox) (logfont, devfont,                            mchar, len, &bbox_x, &bbox_y, &bbox_w, &bbox_h);#if 0        printf ("bbox of %c: %d, %d, %d, %d\n", *mchar, bbox_x, bbox_y, bbox_w, bbox_h);#endif    }    else {        bbox_w = (*devfont->font_ops->get_char_width) (logfont, devfont,                 mchar, len);        bbox_h = h;        bbox_y -= ascent;    }    if (logfont->style & FS_WEIGHT_BOLD         && !(devfont->style & FS_WEIGHT_BOLD)) {        bold = 1;    }    if (logfont->style & FS_SLANT_ITALIC        && !(devfont->style & FS_SLANT_ITALIC)) {        italic = (bbox_h - 1) >> 1;    }    if (logfont->style & FS_WEIGHT_BOOK            && devfont->font_ops->get_char_pixmap) {        bits = (*devfont->font_ops->get_char_pixmap) (logfont, devfont,                 mchar, len, &pitch);    }    else {        bits = (*devfont->font_ops->get_char_bitmap) (logfont, devfont,                 mchar, len);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久人人做人人爱| 国产精品资源在线看| 91影视在线播放| 亚洲国产精品传媒在线观看| 精品在线免费观看| 国产亚洲精品aa| 国产成人一级电影| 中文字幕成人av| 91理论电影在线观看| 亚洲黄网站在线观看| 欧美三级乱人伦电影| 一区二区三区加勒比av| 欧美日韩一级二级| 麻豆精品在线播放| 亚洲精品一区二区在线观看| 国产.欧美.日韩| 国产精品初高中害羞小美女文| av电影天堂一区二区在线| 欧美mv日韩mv国产网站| 国产精品69毛片高清亚洲| 亚洲国产电影在线观看| 91欧美一区二区| 亚洲国产婷婷综合在线精品| 欧美日韩国产欧美日美国产精品| 夜夜精品视频一区二区| 欧美一区三区四区| 精品一二三四在线| 中文字幕一区二区三区四区不卡 | 成人欧美一区二区三区黑人麻豆| 粉嫩久久99精品久久久久久夜| 亚洲视频免费看| 欧美另类z0zxhd电影| 久久99精品国产.久久久久久 | 另类专区欧美蜜桃臀第一页| 欧美国产一区二区| 欧美日韩电影一区| 国产一区欧美一区| 国产丝袜美腿一区二区三区| 99re在线视频这里只有精品| 午夜视频一区二区| 国产婷婷一区二区| 欧美精三区欧美精三区| 国内精品国产三级国产a久久| 成人免费小视频| 91在线国内视频| 国产精品影视在线| 综合自拍亚洲综合图不卡区| 在线不卡a资源高清| 懂色av中文字幕一区二区三区| 一个色综合网站| 国产天堂亚洲国产碰碰| 日本精品裸体写真集在线观看| 欧美aⅴ一区二区三区视频| 国产精品区一区二区三区| 欧美日韩性生活| 成人性视频网站| 男男视频亚洲欧美| 亚洲天堂中文字幕| 欧美mv和日韩mv国产网站| 成人国产电影网| 九九视频精品免费| 亚洲午夜电影在线观看| 欧美国产禁国产网站cc| 欧美丰满高潮xxxx喷水动漫| 成人av片在线观看| 日本欧美在线观看| 亚洲综合色视频| 中文字幕免费不卡在线| 精品日韩在线观看| 欧日韩精品视频| fc2成人免费人成在线观看播放 | 天堂影院一区二区| 一区二区视频在线看| 中文一区二区完整视频在线观看| 91麻豆精品国产91久久久更新时间| 国内精品免费**视频| 免费日韩伦理电影| 一区二区三区四区不卡视频| 最新国产成人在线观看| 中文字幕在线不卡国产视频| 国产精品乱码久久久久久| 日本一区二区三级电影在线观看| 久久久久久久一区| 国产日本欧洲亚洲| 中文字幕乱码日本亚洲一区二区| 中文字幕av资源一区| 国产精品国产三级国产普通话99 | 日韩中文字幕区一区有砖一区 | 成人午夜免费电影| 成人免费av网站| 99re成人在线| 欧美专区亚洲专区| 欧美日韩高清影院| 2024国产精品视频| 国产精品丝袜久久久久久app| 日韩一区日韩二区| 亚洲成人免费电影| 麻豆91免费看| 成人性生交大片| 欧美性一级生活| 日韩一区二区在线免费观看| 久久久久久久久久久久电影| 国产欧美日韩在线| 亚洲已满18点击进入久久| 日本色综合中文字幕| 高清成人免费视频| 欧美日韩精品一区视频| 精品国一区二区三区| 亚洲欧美在线观看| 免费高清不卡av| 99久久er热在这里只有精品15| 欧美视频在线播放| 久久久精品日韩欧美| 亚洲欧美日韩久久精品| 久久精品999| 91蜜桃网址入口| 欧美成人性福生活免费看| 1024成人网| 精品一区二区三区免费| 色婷婷精品久久二区二区蜜臂av| 在线不卡一区二区| 国产精品视频免费| 日本视频免费一区| 色偷偷一区二区三区| 亚洲精品一区二区三区四区高清| 亚洲日本一区二区| 国产精品123| 欧美精选一区二区| 亚洲欧洲精品一区二区三区| 美女免费视频一区二区| 亚洲精品在线观| 一区二区三区在线视频观看| 国产伦理精品不卡| 欧美日韩卡一卡二| 1024精品合集| 国产v综合v亚洲欧| 精品少妇一区二区三区日产乱码 | 成人91在线观看| 欧美一级片免费看| 一区二区三区波多野结衣在线观看| 韩国毛片一区二区三区| 欧美日本在线看| 亚洲三级理论片| 成人美女视频在线观看18| 欧美一级片在线看| 日日摸夜夜添夜夜添国产精品 | 精品伦理精品一区| 午夜国产精品一区| 在线免费不卡视频| 亚洲精品视频一区| 高清国产一区二区| 国产女同性恋一区二区| 国产精品一卡二卡在线观看| 欧美一区二区精品| 亚洲成人激情综合网| 91麻豆免费观看| 亚洲欧洲性图库| jvid福利写真一区二区三区| 国产日产欧美一区二区三区| 激情成人午夜视频| 欧美mv日韩mv| 国产精品一区免费视频| 久久精品在线免费观看| 国模一区二区三区白浆| 久久色.com| 成人性生交大片免费看中文网站| 国产午夜精品久久久久久免费视| 国产美女精品在线| 国产婷婷色一区二区三区| 国产91在线观看丝袜| 中文无字幕一区二区三区| 国产很黄免费观看久久| 国产三级一区二区| 成人激情午夜影院| 亚洲摸摸操操av| 欧美午夜不卡视频| 免费观看一级欧美片| 欧美成人女星排名| 国产精品一区不卡| 国产精品乱码妇女bbbb| 97se亚洲国产综合在线| 亚洲国产成人av网| 日韩精品一区二区三区四区视频 | 99精品国产一区二区三区不卡| 中文字幕高清不卡| 色综合色综合色综合| 亚洲一级二级在线| 欧美大片日本大片免费观看| 国产一区二区三区免费| 国产精品色哟哟| 色噜噜久久综合| 日日摸夜夜添夜夜添亚洲女人| 精品伦理精品一区| 91丨porny丨蝌蚪视频| 天天色综合成人网| 久久久精品2019中文字幕之3| 91亚洲男人天堂| 日韩成人一区二区三区在线观看| 久久女同互慰一区二区三区| 色综合一个色综合亚洲|