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

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

?? bitmap-lite.c

?? ARM9-2410教學實驗系統下Linux下minigui程序
?? C
字號:
/*** $Id: bitmap-lite.c,v 1.17 2003/09/04 03:09:52 weiym Exp $**** Bitmap operations 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);/****************************** Bitmap Support *******************************/void GUIAPI FillBox (HDC hdc, int x, int y, int w, int h){    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.    w += x; h += y;    coor_LP2SP(pdc, &x, &y);    coor_LP2SP(pdc, &w, &h);    rcOutput.left = x;    rcOutput.top  = y;    rcOutput.right = w;    rcOutput.bottom = h;    NormalizeRect (&rcOutput);    w = RECTW (rcOutput); h = RECTH (rcOutput);    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->brushcolor);    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_FillBox (pdc->gc, x, y, w, h, pdc->brushcolor);        }        pClipRect = pClipRect->next;    }    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);}BOOL GUIAPI FillBoxWithBitmap (HDC hdc, int x, int y, int w, int h,                               const BITMAP* pBitmap){    PCLIPRECT pClipRect;    PDC pdc;    void* scaledBitmap;    int sw = pBitmap->bmWidth, sh = pBitmap->bmHeight;    RECT rcOutput;     if (pBitmap->bmWidth <= 0 || pBitmap->bmHeight <= 0 || pBitmap->bmBits == NULL)        return FALSE;    if (w <= 0 || h <= 0) {        w = sw;        h = sh;    }    pdc = dc_HDC2PDC(hdc);    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return TRUE;        }    }    // Transfer logical to device to screen here.    w += x; h += y;    coor_LP2SP(pdc, &x, &y);    coor_LP2SP(pdc, &w, &h);    rcOutput.left = x;    rcOutput.top = y;    rcOutput.right = w;    rcOutput.bottom = h;    NormalizeRect (&rcOutput);    w = RECTW (rcOutput); h = RECTH (rcOutput);    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(FALSE, &rcOutput);    if(w == sw && h == sh)        scaledBitmap = pBitmap->bmBits;    else    {        if ((scaledBitmap = malloc (GAL_BoxSize (pdc->gc, w, h))) == NULL)            goto free_ret;        GAL_ScaleBox (pdc->gc, sw, sh, pBitmap->bmBits, w, h, scaledBitmap);    }    // 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 (pBitmap->bmType != BMP_TYPE_COLORKEY)                GAL_PutBox (pdc->gc, x, y, w, h, scaledBitmap);            else                GAL_PutBoxMask (pdc->gc, x, y, w, h, scaledBitmap, pBitmap->bmColorKey);        }        pClipRect = pClipRect->next;    }free_ret:    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);    if (w != sw || h != sh) {        free (scaledBitmap);    }    return TRUE;}static void bmpGetBoxPart (int bpp, int w, int h, void* part,                            int ow, int oh, void* full, int xo, int yo){    int i;    int offset;    int lineoffset;    int linebytes;    lineoffset = ow * bpp;    linebytes = w * bpp;    offset = (ow * yo + xo) * bpp;        for (i=0; i<h; i++) {        memcpy (part, full + offset, linebytes);        part += linebytes;        offset += lineoffset;    }}BOOL GUIAPI FillBoxWithBitmapPart (HDC hdc, int x, int y, int w, int h,                int bw, int bh, const BITMAP* pBitmap, int xo, int yo){    PCLIPRECT pClipRect;    PDC pdc;    void* scaledBitmap = NULL;    void* partBitmap = NULL;    int sw = pBitmap->bmWidth, sh = pBitmap->bmHeight;    RECT rcOutput;    int bpp;    if (pBitmap->bmWidth <= 0 || pBitmap->bmHeight <= 0 || pBitmap->bmBits == NULL)        return FALSE;    pdc = dc_HDC2PDC(hdc);    bpp = GAL_BytesPerPixel (pdc->gc);    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return TRUE;        }    }    // Transfer logical to device to screen here.    w += x; h += y;    coor_LP2SP(pdc, &x, &y);    coor_LP2SP(pdc, &w, &h);    rcOutput.left = x;    rcOutput.top = y;    rcOutput.right = w;    rcOutput.bottom = h;    NormalizeRect (&rcOutput);    w = RECTW (rcOutput); h = RECTH (rcOutput);    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(FALSE, &rcOutput);    // set graphics context.    GAL_SetGC(pdc->gc);    if (bw <= 0 || bh <= 0) {        scaledBitmap = pBitmap->bmBits;        bw = sw;        bh = sh;    }    else if (bw == sw && bh == sh)        scaledBitmap = pBitmap->bmBits;    else {        if ((scaledBitmap = malloc (GAL_BoxSize(pdc->gc, w, h))) == NULL)            goto free_ret;        GAL_ScaleBox (pdc->gc, sw, sh, pBitmap->bmBits, bw, bh, scaledBitmap);    }    // extract part box    if ((partBitmap = malloc (GAL_BoxSize(pdc->gc, w, h))) == NULL)        goto free_ret;    bmpGetBoxPart (bpp, w, h, partBitmap, bw, bh, scaledBitmap, xo, yo);    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 (pBitmap->bmType != BMP_TYPE_COLORKEY)                GAL_PutBox (pdc->gc, x, y, w, h, partBitmap);            else                GAL_PutBoxMask (pdc->gc, x, y, w, h, partBitmap, pBitmap->bmColorKey);        }        pClipRect = pClipRect->next;    }free_ret:    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);    if (bw != sw || bh != sh)        free (scaledBitmap);    free (partBitmap);    return TRUE;}void GUIAPI PutSavedBoxOnDC (HDC hdc, int x, int y, int w, int h, void* vbuf){    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.    w += x; h += y;    coor_LP2SP(pdc, &x, &y);    coor_LP2SP(pdc, &w, &h);    rcOutput.left = x;    rcOutput.top = y;    rcOutput.right = w;    rcOutput.bottom = h;    NormalizeRect (&rcOutput);    w = RECTW (rcOutput); h = RECTH (rcOutput);    IntersectRect (&rcOutput, &rcOutput, &pdc->ecrgn.rcBound);    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(FALSE, &rcOutput);    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);            GAL_PutBox (pdc->gc, x, y, w, h, vbuf);        }        pClipRect = pClipRect->next;    }    if( !dc_IsMemHDC(hdc) ) ShowCursorForGDI(TRUE, &rcOutput);}void ScreenCopy (int sx, int sy, HDC hdc, int dx, int dy){    PCLIPRECT pClipRect;    PDC pdc;    int offx, offy;    int boxLeft, boxTop, boxWidth, boxHeight;    RECT* prc;    pdc = dc_HDC2PDC(hdc);    if (dc_IsGeneralHDC(hdc)) {        if (!dc_GenerateECRgn (pdc, FALSE)) {            return;        }    }    else        return;    coor_LP2SP(pdc, &dx, &dy);    offx = sx - dx;    offy = sy - dy;    ShowCursorForGDI(FALSE, &g_rcScr);    GAL_SetGC (PHYSICALGC);    GAL_DisableClipping (pdc->gc);    pClipRect = pdc->ecrgn.head;    while (pClipRect)    {        prc = &pClipRect->rc;        boxLeft   = prc->left   + offx;        boxTop    = prc->top    + offy;        boxWidth  = prc->right  - prc->left;        boxHeight = prc->bottom - prc->top;        GAL_CopyBox (pdc->gc, boxLeft, boxTop, boxWidth, boxHeight, prc->left, prc->top);        pClipRect = pClipRect->next;    }    ShowCursorForGDI(TRUE, &g_rcScr);}void GUIAPI BitBlt(HDC hsdc, int sx, int sy, int sw, int sh,                   HDC hddc, int dx, int dy, DWORD dwRop){    PCLIPRECT pClipRect;    PDC psdc, pddc;    RECT rcOutput;    psdc = dc_HDC2PDC(hsdc);    pddc = dc_HDC2PDC(hddc);    if (dc_IsGeneralHDC(hddc)) {        if (!dc_GenerateECRgn (pddc, FALSE)) {            return;        }    }    if (sw <= 0 || sh <= 0) {        sw = RECTW (psdc->DevRC);        sh = RECTH (psdc->DevRC);    }    // Transfer logical to device to screen here.    sw += sx; sh += sy;    coor_LP2SP(psdc, &sx, &sy);    coor_LP2SP(psdc, &sw, &sh);    (sw > sx) ? (sw -= sx) : (sw = sx - sw);    (sh > sy) ? (sh -= sy) : (sh = sy - sh);    coor_LP2SP(pddc, &dx, &dy);    rcOutput.left = dx;    rcOutput.top  = dy;    rcOutput.right = dx + sw;    rcOutput.bottom = dy + sh;    NormalizeRect(&rcOutput);        ShowCursorForGDI(FALSE, &g_rcScr);    // set graphics context.    GAL_SetGC (pddc->gc);    pClipRect = pddc->ecrgn.head;    while(pClipRect)    {        if (DoesIntersect (&rcOutput, &pClipRect->rc)) {            GAL_SetClipping(pddc->gc, pClipRect->rc.left, pClipRect->rc.top,                    pClipRect->rc.right - 1, pClipRect->rc.bottom - 1);            GAL_CrossBlit (psdc->gc, sx, sy, sw, sh, pddc->gc, dx, dy);        }        pClipRect = pClipRect->next;    }    ShowCursorForGDI(TRUE, &g_rcScr);}void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh,                       HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop){    PCLIPRECT pClipRect;    PDC psdc, pddc;    void* srcBitmap = NULL;     void* scaledBitmap = NULL;    RECT rcOutput;    psdc = dc_HDC2PDC(hsdc);    pddc = dc_HDC2PDC(hddc);    if (dc_IsGeneralHDC(hddc)) {        if (!dc_GenerateECRgn (pddc, FALSE)) {            return;        }    }    // Transfer logical to device to screen here.    sw += sx; sh += sy;    coor_LP2SP(psdc, &sx, &sy);    coor_LP2SP(psdc, &sw, &sh);    (sw > sx) ? (sw -= sx) : (sw = sx - sw);    (sh > sy) ? (sh -= sy) : (sh = sy - sh);    dw += dx; dh += dy;    coor_LP2SP(pddc, &dx, &dy);    coor_LP2SP(pddc, &dw, &dh);    rcOutput.left = dx;    rcOutput.top = dy;    rcOutput.right = dw;    rcOutput.bottom = dh;    NormalizeRect (&rcOutput);    dw -= dx; dh -= dy;    if (!dc_IsMemHDC(hddc)) ShowCursorForGDI(FALSE, &g_rcScr);    GAL_SetGC (psdc->gc);    if ((srcBitmap = malloc (GAL_BoxSize (psdc->gc, sw, sh))) == NULL ||         (scaledBitmap = malloc (GAL_BoxSize (pddc->gc, dw, dh))) == NULL)        goto free_ret;    GAL_GetBox (psdc->gc, sx, sy, sw, sh, srcBitmap);    GAL_ScaleBox (psdc->gc, sw, sh, srcBitmap, dw, dh, scaledBitmap);    GAL_SetGC (pddc->gc);    pClipRect = pddc->ecrgn.head;    while(pClipRect)    {        if (DoesIntersect (&rcOutput, &pClipRect->rc)) {            GAL_SetClipping (pddc->gc, pClipRect->rc.left, pClipRect->rc.top,                    pClipRect->rc.right - 1, pClipRect->rc.bottom - 1);            GAL_PutBox (pddc->gc, dx, dy, dw, dh, scaledBitmap);        }        pClipRect = pClipRect->next;    }free_ret:    if (!dc_IsMemHDC(hddc)) ShowCursorForGDI (TRUE, &g_rcScr);    free (srcBitmap);    free (scaledBitmap);}#include "bitmap-comm.c"

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产 日韩 欧美大片| 亚洲精品一区二区在线观看| 久久精品国产成人一区二区三区 | 激情综合网av| 久草热8精品视频在线观看| 国产真实乱偷精品视频免| 蜜臀av亚洲一区中文字幕| 视频在线观看国产精品| 成人av资源在线观看| 国产精品亚洲综合一区在线观看| 国产在线播放一区二区三区| 激情图片小说一区| 91亚洲精品久久久蜜桃| 在线中文字幕不卡| 欧美性xxxxxx少妇| 欧美一三区三区四区免费在线看| 欧美精品亚洲一区二区在线播放| 制服丝袜国产精品| 欧美成人精品1314www| 精品国产免费一区二区三区香蕉 | 97久久精品人人爽人人爽蜜臀 | 亚洲日本va在线观看| 亚洲柠檬福利资源导航| 亚洲综合色区另类av| 午夜精品久久久久久不卡8050| 午夜成人在线视频| 成人免费视频国产在线观看| 色婷婷综合在线| 欧美日韩国产综合草草| 欧美一卡二卡在线| 亚洲男人的天堂网| 国产一区 二区| 欧美日韩一区视频| 91精品久久久久久久99蜜桃| 中文字幕一区二区三区四区 | 欧美无砖专区一中文字| 国产精品美女久久久久av爽李琼| 亚洲人xxxx| 国产91丝袜在线播放0| 欧美一区二区在线播放| 亚洲永久免费av| 波波电影院一区二区三区| 欧美日韩成人在线一区| 一色屋精品亚洲香蕉网站| 韩日av一区二区| 欧美一级黄色片| 国产精品免费看片| 国内成人免费视频| 日韩一级二级三级| 亚洲成av人**亚洲成av**| 国产麻豆精品在线观看| 日韩一区二区三区在线| 亚洲午夜羞羞片| 国产精品996| 日韩欧美综合一区| 婷婷成人综合网| 欧美日韩日日夜夜| 亚洲国产综合视频在线观看| 99久久精品国产一区二区三区| 国产亚洲污的网站| 亚洲成人免费视| 在线亚洲一区观看| 亚洲精品欧美二区三区中文字幕| 美女mm1313爽爽久久久蜜臀| 欧美日韩国产片| 亚洲国产精品久久久久婷婷884| 91免费观看在线| 日韩美女视频一区二区| 成人美女视频在线观看| 国产色产综合产在线视频| 韩国在线一区二区| 久久久国产精品午夜一区ai换脸| 丝袜亚洲精品中文字幕一区| 欧美日韩激情一区二区| 日日欢夜夜爽一区| 欧美一区二区三区性视频| 免费久久99精品国产| 欧美亚洲日本国产| 亚洲第一狼人社区| 欧美一区二区三区人| 久国产精品韩国三级视频| 久久久亚洲国产美女国产盗摄| 国产一区二区免费视频| 国产女人18毛片水真多成人如厕 | 欧美不卡123| 国产乱码精品一品二品| 国产欧美综合色| 成人av网站在线| 亚洲人成网站色在线观看| 欧美午夜寂寞影院| 久久精品国产一区二区| 久久综合精品国产一区二区三区| 日产国产欧美视频一区精品| 91传媒视频在线播放| 偷拍日韩校园综合在线| 精品剧情v国产在线观看在线| 国产一区二区三区四区在线观看| 国产精品久久久久久亚洲毛片| 国产精品亚洲综合一区在线观看| 国产欧美一区二区精品婷婷 | 一区二区不卡在线播放| 99国产精品久久久| 亚洲成在线观看| 精品久久久久香蕉网| 成人激情黄色小说| 香蕉久久夜色精品国产使用方法| 日韩免费电影网站| 伦理电影国产精品| 国产精品你懂的在线| 在线看不卡av| 亚洲国产综合91精品麻豆| 日韩免费福利电影在线观看| 成人app在线观看| 亚洲18色成人| 精品999久久久| 色呦呦一区二区三区| 另类小说综合欧美亚洲| 国产精品大尺度| 日韩女优制服丝袜电影| eeuss影院一区二区三区| 日本欧美肥老太交大片| 国产精品的网站| 欧美一卡2卡三卡4卡5免费| 99免费精品视频| 激情亚洲综合在线| 亚洲一区二区成人在线观看| 亚洲精品一区二区三区影院| 91官网在线免费观看| 国产在线不卡视频| 亚洲图片自拍偷拍| 国产喷白浆一区二区三区| 欧美疯狂性受xxxxx喷水图片| 床上的激情91.| 亚洲大尺度视频在线观看| 国产精品美女久久福利网站| 日韩欧美美女一区二区三区| 色婷婷综合五月| 粉嫩aⅴ一区二区三区四区| 日韩精品国产精品| 一区二区国产视频| 国产蜜臀av在线一区二区三区| 欧美日韩国产精品成人| 91亚洲精品久久久蜜桃| 国产精品 欧美精品| 亚洲色图另类专区| 国产亚洲视频系列| 欧美一卡二卡三卡| 欧美日韩国产在线观看| 一本色道久久综合狠狠躁的推荐| 国产黄色精品网站| 麻豆精品在线观看| 午夜久久久影院| 一区二区三区在线高清| 中文字幕一区二区三区在线观看 | 成人丝袜18视频在线观看| 精品一区二区影视| 日韩中文字幕av电影| 亚洲免费在线观看视频| 国产精品美女视频| 国产亚洲美州欧州综合国| 亚洲精品在线免费播放| 日韩三级中文字幕| 在线不卡a资源高清| 欧美性xxxxxx少妇| 欧美综合在线视频| 日本电影欧美片| 99国产精品久久久| 99久久精品国产精品久久| 成人免费视频视频| 成人午夜又粗又硬又大| 国产一区二区三区不卡在线观看| 久久99国产精品尤物| 老司机免费视频一区二区三区| 欧美aⅴ一区二区三区视频| 五月天亚洲精品| 三级久久三级久久久| 奇米精品一区二区三区四区| 日韩高清一区在线| 麻豆精品久久精品色综合| 久久成人麻豆午夜电影| 麻豆精品视频在线观看视频| 久久99精品久久久久久动态图| 久久91精品国产91久久小草| 韩国一区二区三区| 国产凹凸在线观看一区二区| 国产成人在线观看免费网站| 高清shemale亚洲人妖| 本田岬高潮一区二区三区| 99久久精品国产毛片| 日本高清免费不卡视频| 欧美日韩卡一卡二| 欧美一区二区精品久久911| 日韩视频免费观看高清完整版在线观看 | 久久久精品中文字幕麻豆发布| 国产欧美一区二区精品仙草咪| 中文字幕在线不卡一区二区三区| 18成人在线观看| 亚洲午夜久久久久久久久电影网| 午夜视频在线观看一区二区| 奇米影视一区二区三区|