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

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

?? draw-lite.c

?? minigui的開發程序
?? C
字號:
/* ** $Id: draw-lite.c,v 1.15 2003/11/23 03:39:20 weiym Exp $**** draw-lite.c: General drawing of GDI for MiniGUI-Lite.**** Copyright (C) 2003 Feynman Software.** Copyright (C) 2000 ~ 2002 Wei Yongming.**** Current maintainer: Wei Yongming.** Create date: 2000/06/12, derived from original gdi.c*//*** 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 <string.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 "cursor.h"extern BOOL dc_GenerateECRgn (PDC pdc, BOOL fForce);/*********************** Generl drawing support ******************************/void GUIAPI SetPixel(HDC hdc, int x, int y, gal_pixel c){    PDC pdc;    PCLIPRECT pClipRect;    RECT rcOutput;    pdc = dc_HDC2PDC (hdc);    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return;        }    }    coor_LP2SP (pdc, &x, &y);    rcOutput.left = x - 1;    rcOutput.top  = y - 1;    rcOutput.right = x + 1;    rcOutput.bottom = y + 1;    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if (!dc_IsMemHDC(hdc)) ShowCursorForGDI (FALSE, &rcOutput);    // set graphics context.    GAL_SetGC (pdc->gc);    GAL_SetFgColor (pdc->gc, c);    pClipRect = pdc->ecrgn.head;    while(pClipRect)    {        if(PtInRect(&(pClipRect->rc), x, y)) {            GAL_DrawPixel (pdc->gc, x, y, c);            break;        }        pClipRect = pClipRect->next;    }    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);}void GUIAPI SetPixelRGB(HDC hdc, int x, int y, int r, int g, int b){    PDC pdc;    PCLIPRECT pClipRect;    RECT rcOutput;    gal_pixel pixel;    GAL_Color color;    pdc = dc_HDC2PDC (hdc);    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return;        }    }    coor_LP2SP (pdc, &x, &y);    rcOutput.left = x - 1;    rcOutput.top  = y - 1;    rcOutput.right = x + 1;    rcOutput.bottom = y + 1;    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(FALSE, &rcOutput);    // set graphics context.    GAL_SetGC (pdc->gc);    color.r = r; color.g = g, color.b = b;    pixel = GAL_MapColor (pdc->gc, &color);    GAL_SetFgColor (pdc->gc, pixel);    pClipRect = pdc->ecrgn.head;    while (pClipRect)    {        if(PtInRect(&(pClipRect->rc), x, y)) {            GAL_DrawPixel (pdc->gc, x, y, pixel);            break;        }        pClipRect = pClipRect->next;    }        if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);}gal_pixel GUIAPI GetPixel(HDC hdc, int x, int y){    PDC pdc;    PCLIPRECT pClipRect;    int color = 0;    RECT rcOutput;    pdc = dc_HDC2PDC(hdc);    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return PIXEL_invalid;        }    }    coor_LP2SP (pdc, &x, &y);    rcOutput.left = x - 1;    rcOutput.top  = y - 1;    rcOutput.right = x + 1;    rcOutput.bottom = y + 1;    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if (!dc_IsMemHDC (hdc)) ShowCursorForGDI (FALSE, &rcOutput);    // set graphics context.    GAL_SetGC (pdc->gc);    pClipRect = pdc->ecrgn.head;    while(pClipRect)    {        if(PtInRect(&(pClipRect->rc), x, y)) {            GAL_GetPixel (pdc->gc, x, y, &color);            break;        }        pClipRect = pClipRect->next;    }    if (!dc_IsMemHDC (hdc)) ShowCursorForGDI (TRUE, &rcOutput);    return color;}void GUIAPI GetPixelRGB(HDC hdc, int x, int y, int* r, int* g, int* b){    PDC pdc;    PCLIPRECT pClipRect;    gal_pixel pixel;    GAL_Color color;    RECT rcOutput;    pdc = dc_HDC2PDC(hdc);    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return;        }    }    coor_LP2SP(pdc, &x, &y);    rcOutput.left = x - 1;    rcOutput.top  = y - 1;    rcOutput.right = x + 1;    rcOutput.bottom = y + 1;    *r = 0;    *g = 0;    *b = 0;    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if (!dc_IsMemHDC (hdc)) ShowCursorForGDI (FALSE, &rcOutput);    // set graphics context.    GAL_SetGC (pdc->gc);    pClipRect = pdc->ecrgn.head;    while(pClipRect)    {        if (PtInRect (&(pClipRect->rc), x, y) ) {            GAL_GetPixel (pdc->gc, x, y, &pixel);            GAL_UnmapPixel (pdc->gc, pixel, &color);            *r = color.r;            *g = color.g;            *b = color.b;            break;        }        pClipRect = pClipRect->next;    }    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);}gal_pixel GUIAPI RGB2Pixel (HDC hdc, int r, int g, int b){    PDC pdc;    gal_pixel pixel;    GAL_Color color = {r, g, b};    pdc = dc_HDC2PDC (hdc);    GAL_SetGC (pdc->gc);    pixel = GAL_MapColor (pdc->gc, &color);     return pixel;}void GUIAPI MoveTo (HDC hdc, int x, int y){    PDC pdc;    pdc = dc_HDC2PDC(hdc);    pdc->CurPenPos.x = x;    pdc->CurPenPos.y = y;}void GUIAPI LineTo (HDC hdc, int x, int y){    PCLIPRECT pClipRect;    PDC pdc;    RECT rcOutput;    int startx, starty;    pdc = dc_HDC2PDC(hdc);    startx = pdc->CurPenPos.x;    starty = pdc->CurPenPos.y;    // Move the current pen pos.    pdc->CurPenPos.x = x;    pdc->CurPenPos.y = y;    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return;        }    }    // Transfer logical to device to screen here.    coor_LP2SP(pdc, &x, &y);    coor_LP2SP(pdc, &startx, &starty);    rcOutput.left = startx;    rcOutput.top  = starty;    rcOutput.right = x;    rcOutput.bottom = y;    NormalizeRect (&rcOutput);    InflateRect (&rcOutput, 1, 1);    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(FALSE, &rcOutput);    // set graphics context.    GAL_SetGC (pdc->gc);    GAL_SetFgColor (pdc->gc, pdc->pencolor);    pClipRect = pdc->ecrgn.head;    while(pClipRect)    {        if (DoesIntersect (&rcOutput, &pClipRect->rc)) {            GAL_SetClipping (pdc->gc, pClipRect->rc.left, pClipRect->rc.top,                    pClipRect->rc.right - 1, pClipRect->rc.bottom - 1);            if(starty == y) {                if (startx > x)                    GAL_DrawHLine (pdc->gc, x, y, startx - x, pdc->pencolor);                else                    GAL_DrawHLine (pdc->gc, startx, y, x - startx, pdc->pencolor);            }            else                GAL_Line (pdc->gc, startx, starty, x, y, pdc->pencolor);        }                    pClipRect = pClipRect->next;    }    if (!dc_IsMemHDC (hdc)) ShowCursorForGDI (TRUE, &rcOutput);}void GUIAPI PolylineTo (HDC hdc, const POINT* point, int poinum){    int   i;    MoveTo (hdc, point[0].x, point[0].y);    for (i=1; i<poinum; i++)        LineTo (hdc, point[i].x, point[i].y);}/************************ Circle and Rectangle *******************************/void GUIAPI Circle(HDC hdc, int x, int y, int r){    PCLIPRECT pClipRect;    PDC pdc;    RECT rcOutput;    pdc = dc_HDC2PDC(hdc);    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return;        }    }    // Transfer logical to device to screen here.    coor_LP2SP(pdc, &x, &y);    rcOutput.left = x - r;    rcOutput.top  = y - r;    rcOutput.right = x + r + 1;    rcOutput.bottom = y + r + 1;    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(FALSE, &rcOutput);    // set graphics context.    GAL_SetGC (pdc->gc);    GAL_SetFgColor (pdc->gc, pdc->pencolor);    pClipRect = pdc->ecrgn.head;    while(pClipRect)    {        if (DoesIntersect (&rcOutput, &pClipRect->rc)) {            GAL_SetClipping (pdc->gc, pClipRect->rc.left, pClipRect->rc.top,                    pClipRect->rc.right -1 , pClipRect->rc.bottom - 1);            GAL_Circle (pdc->gc, x, y, r, pdc->pencolor);        }                    pClipRect = pClipRect->next;    }    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);}void GUIAPI Rectangle (HDC hdc, int x0, int y0, int x1, int y1){    PCLIPRECT pClipRect;    PDC pdc;    RECT rcOutput;    pdc = dc_HDC2PDC(hdc);    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return;        }    }    // Transfer logical to device to screen here.    coor_LP2SP(pdc, &x0, &y0);     coor_LP2SP(pdc, &x1, &y1);         rcOutput.left = x0;    rcOutput.top = y0;    rcOutput.right = x1;    rcOutput.bottom = y1;    NormalizeRect (&rcOutput);    rcOutput.right ++;    rcOutput.bottom ++;    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(FALSE, &rcOutput);    // set graphics context.    GAL_SetGC (pdc->gc);    GAL_SetFgColor (pdc->gc, pdc->pencolor);    pClipRect = pdc->ecrgn.head;    while(pClipRect)    {        if (DoesIntersect (&rcOutput, &pClipRect->rc)) {            GAL_SetClipping (pdc->gc, pClipRect->rc.left, pClipRect->rc.top,                    pClipRect->rc.right - 1, pClipRect->rc.bottom - 1);            GAL_Rectangle (pdc->gc, x0, y0, x1, y1, pdc->pencolor);        }                    pClipRect = pClipRect->next;    }        if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);}void GUIAPI FocusRect(HDC hdc, int x0, int y0, int x1, int y1){    PCLIPRECT pClipRect;    PDC pdc;    int l, t, r, b, w, h;    RECT rcOutput;    size_t sizeh, sizev;    BYTE* vbuff;    BYTE* hline1 = NULL, * hline2 = NULL;    BYTE* vline1 = NULL, * vline2 = NULL;    int bpp;    BYTE xor_byte;    pdc = dc_HDC2PDC(hdc);    bpp = GAL_BytesPerPixel (pdc->gc);    if (GAL_BitsPerPixel (pdc->gc) < 8)        xor_byte = 0x0F;    else        xor_byte = 0xFF;    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return;        }    }    // Transfer logical to device to screen here.    coor_LP2SP(pdc, &x0, &y0);     coor_LP2SP(pdc, &x1, &y1);     l = MIN (x0, x1); t = MIN (y0, y1); r = MAX (x0, x1); b = MAX (y0, y1);    rcOutput.left = l; rcOutput.top = t;    rcOutput.right = r + 1; rcOutput.bottom = b + 1;    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(FALSE, &rcOutput);    GAL_SetGC (pdc->gc);    w = r - l + 1;    h = b - t - 1;    if (w == 0 || h == 0)        goto my_exit;    sizeh = w * bpp;    sizev = h * bpp;#ifdef HAVE_ALLOCA    if (!(vbuff = alloca ((sizeh << 1) + (sizev << 1))))#else    if (!(vbuff = malloc ((sizeh << 1) + (sizev << 1))))#endif        goto my_exit;    if (w > 0) {        int i, j;        int offset;               hline1 = vbuff;        hline2 = vbuff + sizeh;        GAL_GetBox (pdc->gc, l, t, w, 1, hline1);        GAL_GetBox (pdc->gc, l, b, w, 1, hline2);        offset = 0;        for (i = 0; i < w; i += 2) {            for (j = 0; j < bpp; j++) {                hline1[offset + j] ^= xor_byte;                hline2[offset + j] ^= xor_byte;            }            offset += bpp << 1;         }    }        if (h > 0) {        int i, j, offset;                vline1 = vbuff + (sizeh << 1);        vline2 = vbuff + (sizeh << 1) + sizev;                    GAL_GetBox (pdc->gc, l, t + 1, 1, h, vline1);        GAL_GetBox (pdc->gc, r, t + 1, 1, h, vline2);                offset = 0;        for (i = 0; i < h; i += 2) {            for (j = 0; j < bpp; j++) {                vline1[offset + j] ^= xor_byte;                vline2[offset + j] ^= xor_byte;            }            offset += bpp << 1;         }    }    // set graphics context.    GAL_SetGC (pdc->gc);    pClipRect = pdc->ecrgn.head;    while(pClipRect)    {        if (DoesIntersect (&rcOutput, &pClipRect->rc)) {            GAL_SetClipping(pdc->gc, pClipRect->rc.left, pClipRect->rc.top,                    pClipRect->rc.right - 1, pClipRect->rc.bottom - 1);                        if (hline1) {                GAL_PutBox (pdc->gc, l, t, w, 1, hline1);                GAL_PutBox (pdc->gc, l, b, w, 1, hline2);            }                        if (vline1) {                GAL_PutBox (pdc->gc, l, t + 1, 1, h, vline1);                GAL_PutBox (pdc->gc, r, t + 1, 1, h, vline2);            }        }                    pClipRect = pClipRect->next;    }    my_exit:    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);    free (vbuff);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
香蕉成人啪国产精品视频综合网| av在线这里只有精品| 国模无码大尺度一区二区三区| 岛国精品一区二区| 日韩三级电影网址| 亚洲一区在线观看网站| 国产精品一区免费视频| 日韩欧美国产1| 日韩综合一区二区| 日本精品免费观看高清观看| 国产亚洲一二三区| 美女国产一区二区三区| 91国产丝袜在线播放| 中文字幕色av一区二区三区| 国产在线看一区| 日韩一区二区三区精品视频| 亚洲a一区二区| 在线国产电影不卡| 亚洲精选视频在线| 成人91在线观看| 国产精品伦一区二区三级视频| 另类小说综合欧美亚洲| 日韩欧美一区二区免费| 日本女人一区二区三区| 欧美日韩一卡二卡三卡| 亚洲五月六月丁香激情| 日本道色综合久久| 亚洲免费av高清| 91黄色免费网站| 亚洲大片免费看| 欧美久久婷婷综合色| 亚洲一二三四久久| 欧美日韩一区不卡| 日韩av电影免费观看高清完整版 | 精品一二线国产| 91精品欧美一区二区三区综合在| 一个色综合网站| 欧美探花视频资源| 亚洲6080在线| 欧美区一区二区三区| 日韩国产欧美在线播放| 日韩亚洲欧美中文三级| 国内精品嫩模私拍在线| 久久久99精品久久| jvid福利写真一区二区三区| 亚洲欧美日韩国产综合在线| 在线一区二区观看| 丝袜美腿成人在线| 日韩一区二区三区在线观看| 国产一区二区中文字幕| 中文字幕av资源一区| 99视频精品全部免费在线| 一个色综合网站| 日韩欧美中文字幕精品| 色综合色狠狠综合色| 亚洲精品欧美综合四区| 欧美高清视频一二三区 | 日韩欧美国产综合一区 | 亚洲免费在线观看视频| 欧美日韩黄色影视| 国产一区日韩二区欧美三区| 国产精品美女久久久久aⅴ国产馆| 色诱视频网站一区| 男女激情视频一区| 自拍偷拍欧美激情| 欧美一级理论片| 成人午夜免费视频| 日本一不卡视频| 国产精品久久777777| 777奇米四色成人影色区| 国产精品小仙女| 午夜久久久久久久久| 久久久久久9999| 欧美精品第1页| 99九九99九九九视频精品| 青青草精品视频| 日韩美女视频19| 精品成人在线观看| 欧美午夜影院一区| 成人理论电影网| 麻豆91小视频| 亚洲成人av一区二区三区| 中文字幕第一页久久| 国产精品色噜噜| 精品美女在线播放| 欧美精品1区2区| 99r国产精品| 国产精品小仙女| 麻豆成人久久精品二区三区小说| 亚洲同性同志一二三专区| 久久久影视传媒| 91精品中文字幕一区二区三区| 99久久精品一区| 丁香六月久久综合狠狠色| 蜜臀国产一区二区三区在线播放| 亚洲激情图片一区| 国产精品久久久久久久久动漫| 精品国产乱码久久久久久图片| 欧美在线一区二区三区| 99久久er热在这里只有精品66| 国产精品夜夜爽| 国内成人免费视频| 日产国产欧美视频一区精品| 亚洲嫩草精品久久| 国产精品不卡视频| 国产亚洲一本大道中文在线| 欧美zozo另类异族| 日韩一区二区三区在线视频| 欧美日韩日日骚| 欧美日韩国产精选| 欧美精三区欧美精三区| 欧美色精品在线视频| 色欧美片视频在线观看| 日本道免费精品一区二区三区| 色一情一伦一子一伦一区| 99国产麻豆精品| 91视频.com| 欧美系列日韩一区| 欧美人动与zoxxxx乱| 日韩一区二区电影| 欧美精品一区二区三区蜜桃视频 | 精品一区二区在线看| 久久精品国产免费| 国产一区二区女| 粉嫩在线一区二区三区视频| 成人丝袜18视频在线观看| 成人国产免费视频| 色网综合在线观看| 欧美日韩精品电影| 欧美精品一区二区三区蜜臀 | 亚洲午夜影视影院在线观看| 亚洲成av人在线观看| 蜜臀精品一区二区三区在线观看| 久久91精品久久久久久秒播| 国产精品1024| 粉嫩一区二区三区在线看| 99精品视频在线免费观看| 精品视频在线免费| 欧美大胆一级视频| 国产精品久久一卡二卡| 亚洲国产精品一区二区久久 | 日韩欧美亚洲国产另类| 久久免费看少妇高潮| 亚洲视频一二区| 国产69精品久久久久777| 91丝袜高跟美女视频| 精品视频在线免费| 国产亚洲欧美日韩俺去了| 中文字幕中文字幕在线一区 | 亚洲欧美激情一区二区| 日韩国产精品91| 成人一二三区视频| 欧美色图在线观看| 26uuu久久综合| 1024亚洲合集| 精品一区二区在线免费观看| 色综合一个色综合亚洲| 精品伦理精品一区| 一区二区三区四区国产精品| 精品一区二区三区在线视频| 99久久综合国产精品| 日韩一区二区电影| 亚洲黄色尤物视频| 国产福利视频一区二区三区| 91精品欧美福利在线观看| 国产精品久久久久久久久果冻传媒| 日韩av网站免费在线| 一本大道久久a久久精品综合| 日韩免费高清视频| 亚洲va欧美va人人爽午夜| 99久久伊人网影院| 国产网站一区二区三区| 秋霞电影一区二区| 色菇凉天天综合网| 欧美激情一区二区三区| 日韩av一区二区在线影视| 欧美系列在线观看| 亚洲精品成人a在线观看| 成人性生交大片免费| 久久精品一二三| 久久99精品国产.久久久久久| 91麻豆精品国产91久久久久久久久 | 亚洲黄色录像片| 成人伦理片在线| 国产欧美日韩卡一| 国产伦精品一区二区三区在线观看| 91精品久久久久久蜜臀| 亚洲精品国产第一综合99久久| www.色精品| 中文字幕中文字幕一区二区| 丁香激情综合国产| 欧美国产在线观看| 国产成人亚洲综合a∨婷婷| 精品国产伦一区二区三区观看方式| 日韩中文字幕不卡| 69久久99精品久久久久婷婷| 性久久久久久久| 欧美二区在线观看| 日韩成人av影视| 91精品婷婷国产综合久久|