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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rpng-win.c

?? linux 2.6kernel下面png庫
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
    /* if the user didn't specify a background color on the command line,     * check for one in the PNG file--if not, the initialized values of 0     * (black) will be used */    if (have_bg)        sscanf(bgstr+1, "%2x%2x%2x", &bg_red, &bg_green, &bg_blue);    else if (readpng_get_bgcolor(&bg_red, &bg_green, &bg_blue) > 1) {        readpng_cleanup(TRUE);        fprintf(stderr, PROGNAME          ":  libpng error while checking for background color\n");        exit(2);    }    /* do the basic Windows initialization stuff, make the window and fill it     * with the background color */    if (rpng_win_create_window(hInst, showmode))        exit(2);    /* decode the image, all at once */    Trace((stderr, "calling readpng_get_image()\n"))    image_data = readpng_get_image(display_exponent, &image_channels,      &image_rowbytes);    Trace((stderr, "done with readpng_get_image()\n"))    /* done with PNG file, so clean up to minimize memory usage (but do NOT     * nuke image_data!) */    readpng_cleanup(FALSE);    fclose(infile);    if (!image_data) {        fprintf(stderr, PROGNAME ":  unable to decode PNG image\n");        exit(3);    }    /* display image (composite with background if requested) */    Trace((stderr, "calling rpng_win_display_image()\n"))    if (rpng_win_display_image()) {        free(image_data);        exit(4);    }    Trace((stderr, "done with rpng_win_display_image()\n"))    /* wait for the user to tell us when to quit */    printf(      "Done.  Press Q, Esc or mouse button 1 (within image window) to quit.\n");    fflush(stdout);    while (GetMessage(&msg, NULL, 0, 0)) {        TranslateMessage(&msg);        DispatchMessage(&msg);    }    /* OK, we're done:  clean up all image and Windows resources and go away */    rpng_win_cleanup();    return msg.wParam;}static int rpng_win_create_window(HINSTANCE hInst, int showmode){    uch *dest;    int extra_width, extra_height;    ulg i, j;    WNDCLASSEX wndclass;/*---------------------------------------------------------------------------    Allocate memory for the display-specific version of the image (round up    to multiple of 4 for Windows DIB).  ---------------------------------------------------------------------------*/    wimage_rowbytes = ((3*image_width + 3L) >> 2) << 2;    if (!(dib = (uch *)malloc(sizeof(BITMAPINFOHEADER) +                              wimage_rowbytes*image_height)))    {        return 4;   /* fail */    }/*---------------------------------------------------------------------------    Initialize the DIB.  Negative height means to use top-down BMP ordering    (must be uncompressed, but that's what we want).  Bit count of 1, 4 or 8    implies a colormap of RGBX quads, but 24-bit BMPs just use B,G,R values    directly => wimage_data begins immediately after BMP header.  ---------------------------------------------------------------------------*/    memset(dib, 0, sizeof(BITMAPINFOHEADER));    bmih = (BITMAPINFOHEADER *)dib;    bmih->biSize = sizeof(BITMAPINFOHEADER);    bmih->biWidth = image_width;    bmih->biHeight = -((long)image_height);    bmih->biPlanes = 1;    bmih->biBitCount = 24;    bmih->biCompression = 0;    wimage_data = dib + sizeof(BITMAPINFOHEADER);/*---------------------------------------------------------------------------    Fill in background color (black by default); data are in BGR order.  ---------------------------------------------------------------------------*/    for (j = 0;  j < image_height;  ++j) {        dest = wimage_data + j*wimage_rowbytes;        for (i = image_width;  i > 0;  --i) {            *dest++ = bg_blue;            *dest++ = bg_green;            *dest++ = bg_red;        }    }/*---------------------------------------------------------------------------    Set the window parameters.  ---------------------------------------------------------------------------*/    memset(&wndclass, 0, sizeof(wndclass));    wndclass.cbSize = sizeof(wndclass);    wndclass.style = CS_HREDRAW | CS_VREDRAW;    wndclass.lpfnWndProc = rpng_win_wndproc;    wndclass.hInstance = hInst;    wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);    wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);    wndclass.hbrBackground = (HBRUSH)GetStockObject(DKGRAY_BRUSH);    wndclass.lpszMenuName = NULL;    wndclass.lpszClassName = progname;    wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);    RegisterClassEx(&wndclass);/*---------------------------------------------------------------------------    Finally, create the window.  ---------------------------------------------------------------------------*/    extra_width  = 2*(GetSystemMetrics(SM_CXBORDER) +                      GetSystemMetrics(SM_CXDLGFRAME));    extra_height = 2*(GetSystemMetrics(SM_CYBORDER) +                      GetSystemMetrics(SM_CYDLGFRAME)) +                      GetSystemMetrics(SM_CYCAPTION);    global_hwnd = CreateWindow(progname, titlebar, WS_OVERLAPPEDWINDOW,      CW_USEDEFAULT, CW_USEDEFAULT, image_width+extra_width,      image_height+extra_height, NULL, NULL, hInst, NULL);    ShowWindow(global_hwnd, showmode);    UpdateWindow(global_hwnd);    return 0;} /* end function rpng_win_create_window() */static int rpng_win_display_image(){    uch *src, *dest;    uch r, g, b, a;    ulg i, row, lastrow;    RECT rect;    Trace((stderr, "beginning display loop (image_channels == %d)\n",      image_channels))    Trace((stderr, "(width = %ld, rowbytes = %ld, wimage_rowbytes = %d)\n",      image_width, image_rowbytes, wimage_rowbytes))/*---------------------------------------------------------------------------    Blast image data to buffer.  This whole routine takes place before the    message loop begins, so there's no real point in any pseudo-progressive    display...  ---------------------------------------------------------------------------*/    for (lastrow = row = 0;  row < image_height;  ++row) {        src = image_data + row*image_rowbytes;        dest = wimage_data + row*wimage_rowbytes;        if (image_channels == 3) {            for (i = image_width;  i > 0;  --i) {                r = *src++;                g = *src++;                b = *src++;                *dest++ = b;                *dest++ = g;   /* note reverse order */                *dest++ = r;            }        } else /* if (image_channels == 4) */ {            for (i = image_width;  i > 0;  --i) {                r = *src++;                g = *src++;                b = *src++;                a = *src++;                if (a == 255) {                    *dest++ = b;                    *dest++ = g;                    *dest++ = r;                } else if (a == 0) {                    *dest++ = bg_blue;                    *dest++ = bg_green;                    *dest++ = bg_red;                } else {                    /* this macro (copied from png.h) composites the                     * foreground and background values and puts the                     * result into the first argument; there are no                     * side effects with the first argument */                    alpha_composite(*dest++, b, a, bg_blue);                    alpha_composite(*dest++, g, a, bg_green);                    alpha_composite(*dest++, r, a, bg_red);                }            }        }        /* display after every 16 lines */        if (((row+1) & 0xf) == 0) {            rect.left = 0L;            rect.top = (LONG)lastrow;            rect.right = (LONG)image_width;      /* possibly off by one? */            rect.bottom = (LONG)lastrow + 16L;   /* possibly off by one? */            InvalidateRect(global_hwnd, &rect, FALSE);            UpdateWindow(global_hwnd);     /* similar to XFlush() */            lastrow = row + 1;        }    }    Trace((stderr, "calling final image-flush routine\n"))    if (lastrow < image_height) {        rect.left = 0L;        rect.top = (LONG)lastrow;        rect.right = (LONG)image_width;      /* possibly off by one? */        rect.bottom = (LONG)image_height;    /* possibly off by one? */        InvalidateRect(global_hwnd, &rect, FALSE);        UpdateWindow(global_hwnd);     /* similar to XFlush() */    }/*    last param determines whether or not background is wiped before paint    InvalidateRect(global_hwnd, NULL, TRUE);    UpdateWindow(global_hwnd); */    return 0;}static void rpng_win_cleanup(){    if (image_data) {        free(image_data);        image_data = NULL;    }    if (dib) {        free(dib);        dib = NULL;    }}LRESULT CALLBACK rpng_win_wndproc(HWND hwnd, UINT iMsg, WPARAM wP, LPARAM lP){    HDC         hdc;    PAINTSTRUCT ps;    int rc;    switch (iMsg) {        case WM_CREATE:            /* one-time processing here, if any */            return 0;        case WM_PAINT:            hdc = BeginPaint(hwnd, &ps);                    /*                    dest                          */            rc = StretchDIBits(hdc, 0, 0, image_width, image_height,                    /*                    source                        */                                    0, 0, image_width, image_height,                                    wimage_data, (BITMAPINFO *)bmih,                    /*              iUsage: no clue                     */                                    0, SRCCOPY);            EndPaint(hwnd, &ps);            return 0;        /* wait for the user to tell us when to quit */        case WM_CHAR:            switch (wP) {      /* only need one, so ignore repeat count */                case 'q':                case 'Q':                case 0x1B:     /* Esc key */                    PostQuitMessage(0);            }            return 0;        case WM_LBUTTONDOWN:   /* another way of quitting */        case WM_DESTROY:            PostQuitMessage(0);            return 0;    }    return DefWindowProc(hwnd, iMsg, wP, lP);}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线区一区二视频| 成人免费观看视频| 欧美精品在线视频| 五月激情六月综合| 69堂国产成人免费视频| 亚洲成av人片| 欧美成人a在线| 国产福利一区二区三区| 国产精品五月天| 色综合久久久久久久久久久| 亚洲444eee在线观看| 欧美一区三区四区| 国产一区二区三区在线观看免费视频| 久久久久久久精| 99国内精品久久| 亚洲大片精品永久免费| 欧美不卡一区二区三区四区| 丁香激情综合国产| 亚洲综合无码一区二区| 精品欧美一区二区三区精品久久| 成人综合在线观看| 亚洲高清视频在线| 久久久99免费| 欧美在线999| 韩国女主播一区二区三区| 亚洲女女做受ⅹxx高潮| 色视频成人在线观看免| 久久精品国产精品青草| 国产精品午夜电影| 日韩一区二区三区四区五区六区| 成人性生交大片免费看中文 | 国产 日韩 欧美大片| 一区二区三区日韩欧美| 日韩精品一区二区三区视频| 91色porny在线视频| 精品在线观看视频| 亚洲国产aⅴ成人精品无吗| 欧美激情艳妇裸体舞| 欧美精品第一页| www.亚洲精品| 极品销魂美女一区二区三区| 亚洲在线观看免费视频| 国产精品久久一级| 精品精品国产高清一毛片一天堂| 欧美性xxxxxxxx| 成人深夜视频在线观看| 美日韩一级片在线观看| 亚洲国产视频a| 1区2区3区欧美| 欧美精彩视频一区二区三区| 欧美一区二区三区视频免费| 色综合久久综合中文综合网| 粉嫩嫩av羞羞动漫久久久| 久久精品国产精品青草| 偷拍日韩校园综合在线| 亚洲人成小说网站色在线 | 亚洲人成亚洲人成在线观看图片| 久久亚洲一区二区三区四区| 69堂国产成人免费视频| 欧美日韩五月天| 欧美最猛黑人xxxxx猛交| 91片黄在线观看| 波多野结衣在线aⅴ中文字幕不卡| 九一久久久久久| 免费精品99久久国产综合精品| 亚洲午夜视频在线观看| 亚洲视频在线一区| 最新不卡av在线| 专区另类欧美日韩| 中文字幕在线一区二区三区| 亚洲国产精品黑人久久久| 国产清纯白嫩初高生在线观看91| 久久婷婷国产综合国色天香| 欧美va天堂va视频va在线| 欧美一区二区三区的| 884aa四虎影成人精品一区| 欧美午夜精品一区二区三区| 欧美三级日韩三级| 国产色婷婷亚洲99精品小说| 久久久久久久免费视频了| 久久久99久久精品欧美| 中文字幕第一页久久| 国产精品美女久久久久aⅴ| 国产精品久久久久久久蜜臀 | 在线一区二区三区四区| 色老汉av一区二区三区| 欧美日韩在线播放三区| 欧美三级日韩在线| 欧美刺激午夜性久久久久久久| 日韩一区二区在线看片| 久久久久国产精品麻豆| 国产精品美女久久久久aⅴ国产馆| 亚洲欧洲一区二区在线播放| 一区二区三区**美女毛片| 午夜成人在线视频| 久久99精品久久久久久国产越南| 国产精品一区二区三区网站| 成人丝袜视频网| 欧美在线影院一区二区| 日韩欧美国产电影| 国产人成一区二区三区影院| 亚洲免费视频成人| 美女网站一区二区| 波多野结衣一区二区三区| 欧美专区日韩专区| 精品粉嫩aⅴ一区二区三区四区| 久久久亚洲国产美女国产盗摄| 自拍偷拍亚洲欧美日韩| 男男成人高潮片免费网站| 国产福利一区二区三区视频| 欧美亚洲图片小说| 久久久久国色av免费看影院| 亚洲人成网站影音先锋播放| 蜜臀av性久久久久av蜜臀妖精| 国产凹凸在线观看一区二区| 91久久精品一区二区二区| 日韩欧美激情在线| 成人免费在线播放视频| 免费精品视频在线| 91豆麻精品91久久久久久| 精品久久久久久最新网址| 亚洲精品免费电影| 国模套图日韩精品一区二区| 在线欧美小视频| 国产欧美综合在线观看第十页 | 国产精品美女一区二区三区 | 国产女人18毛片水真多成人如厕| 亚洲一区二区三区四区中文字幕| 国产经典欧美精品| 欧美日韩黄色一区二区| 中文字幕日韩一区| 久草中文综合在线| 欧美精选一区二区| 亚洲免费在线播放| 高清不卡一二三区| 精品国产成人系列| 亚洲成人在线免费| 91在线小视频| 国产视频一区在线观看| 久久精品国产澳门| 欧美精品日韩精品| 夜夜嗨av一区二区三区中文字幕| 国产精品91一区二区| 欧美一卡2卡三卡4卡5免费| 亚洲精品国产视频| fc2成人免费人成在线观看播放| 欧美电影免费观看高清完整版在线 | 国产精品人人做人人爽人人添 | ...av二区三区久久精品| 精品在线亚洲视频| 日韩一二在线观看| 婷婷久久综合九色综合绿巨人 | 国内精品在线播放| 欧美一级一级性生活免费录像| 亚洲一二三区视频在线观看| 91小视频在线免费看| 国产精品日日摸夜夜摸av| 国产丶欧美丶日本不卡视频| 欧美v日韩v国产v| 看片的网站亚洲| 日韩三级视频中文字幕| 日本黄色一区二区| 亚洲卡通动漫在线| 91丨porny丨蝌蚪视频| 中文字幕中文在线不卡住| 成人av在线网站| 国产精品久久久一区麻豆最新章节| 国产精品2024| 中文字幕精品一区二区三区精品 | 91性感美女视频| 玉足女爽爽91| 在线这里只有精品| 亚洲香肠在线观看| 在线不卡一区二区| 免费观看日韩av| 精品国产免费人成电影在线观看四季 | 精品制服美女丁香| 国产日本欧洲亚洲| av午夜一区麻豆| 亚洲伦理在线免费看| 在线日韩一区二区| 日韩电影在线观看网站| 欧美成人在线直播| 国产99久久久久| 亚洲欧美激情小说另类| 欧洲一区二区三区免费视频| 日韩国产欧美在线播放| 精品日韩欧美一区二区| 成人精品一区二区三区中文字幕 | 国产日韩成人精品| 成人黄页在线观看| 亚洲最大色网站| 日韩欧美激情四射| 高清不卡一二三区| 天堂一区二区在线| 久久新电视剧免费观看| 色欲综合视频天天天| 免费成人性网站| 国产精品不卡一区| 欧美精品亚洲一区二区在线播放|