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

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

?? graphics.c

?? c語言開發方面的經典問題,包括源代碼.c語言開發所要注意的問題,以及在嵌入式等各方面的應用
?? C
?? 第 1 頁 / 共 4 頁
字號:
 * foreground/background colors, the drawing pens, and the brushes * for filled regions. */static void InitDrawingTools(void){    int i;    nFonts = 0;    previousColor = 0;    drawColor = RGB(0, 0, 0);    eraseColor = RGB(255, 255, 255);    drawPen = (HPEN) CreatePen(PS_SOLID, 1, drawColor);    erasePen = (HPEN) CreatePen(PS_SOLID, 1, eraseColor);    nullPen = (HPEN) GetStockObject(NULL_PEN);    if (drawPen == NULL || erasePen == NULL || nullPen == NULL) {        Error("Internal error: Can't initialize pens");    }    for (i = 0; i < NFills; i++) {        fillBitmaps[i] = CreateBitmap(8, 8, 1, 1, fillList[i]);    }    SelectObject(osdc, drawPen);}/* * Function: DisplayExit * Usage: DisplayExit(); * --------------------- * This function is called when the program exits and waits for the * user to type a carriage return.  After reading and ignoring the * return key, this function frees the window system handles and * destroys the console window, thereby exiting the program. */static void DisplayExit(void){    int i;    if (pauseOnExit) (void) getchar();    DeleteDC(osdc);    DeleteDC(gdc);    DestroyWindow(consoleWindow);    DestroyWindow(graphicsWindow);    DeleteObject(drawPen);    DeleteObject(erasePen);    DeleteObject(nullPen);    for (i = 0; i < nFonts; i++) {        DeleteObject(fontTable[i].font);    }    for (i = 0; i < NFills; i++) {        DeleteObject(fillBitmaps[i]);    }}/* * Function: FindConsoleWindow * Usage: window = FindConsoleWindow(); * ------------------------------------ * The EasyWin package makes almost everything about the graphics * package easy in the Borland world.  The only thing that is hard * is getting the handle of the window used for the console in the * first place.  This function finds the console window handle by * enumerating the windows and looking for the first one whose * title ends with .EXE, which the EasyWin package puts there. */static HWND FindConsoleWindow(void){    HWND result;    EnumWindows(EnumerateProc, (LPARAM) &result);    return (result);}/* * Function: EnumerateProc * Usage: Not called directly * -------------------------- * This callback procedure is used by the FindConsoleWindow * call to find the window whose title ends with .EXE. */static BOOL CALLBACK EnumerateProc(HWND window, LPARAM clientData){    HWND *wptr;    char title[MaxTitle];    bool ok;    wptr = (HWND *) clientData;    ok = GetWindowText(window, title, MaxTitle-1);    if (ok && strcmp(title + strlen(title) - 4, ".EXE")==0) {        *wptr = window;        return (0);    }    return (1);}/* * Function: RegisterWindowClass * Usage: RegisterWindowClass(); * ----------------------------- * This function registers the window class used for the graphics * window. */static void RegisterWindowClass(void){    WNDCLASS wcApp;    wcApp.lpszClassName = GWClassName;    wcApp.hInstance = NULL;    wcApp.lpfnWndProc = GraphicsEventProc;    wcApp.hCursor = NULL;    wcApp.hIcon = NULL;    wcApp.lpszMenuName = NULL;    wcApp.hbrBackground = GetStockObject(WHITE_BRUSH);    wcApp.style = CS_HREDRAW | CS_VREDRAW;    wcApp.cbClsExtra = wcApp.cbWndExtra = 0;    if (!RegisterClass(&wcApp)) {        Error("Internal error: RegisterClass failed\n");    }}/* * Function: GraphicsEventProc * Usage: Not called directly * -------------------------- * This function is called when an event is received for the * graphics window.  The only event this package needs to handle * is the paint event, which forces a screen update. */static LONG FAR PASCAL GraphicsEventProc(HWND w, UINT msg,                                         WPARAM p1, LPARAM p2){    if (msg == WM_PAINT) {        DoUpdate();        return (0L);    }    if (msg >= WM_MOUSEFIRST && msg <= WM_MOUSELAST) {        mouseX = LOWORD(p2);        mouseY = HIWORD(p2);        mouseButton = (p1 & AnyButton) != 0;        return (0L);    }    return (DefWindowProc(w, msg, p1, p2));}/* * Function: DoUpdate * Usage: DoUpdate(); * ------------------ * This function redraws the graphics window by copying bits from * the offscreen bitmap behind the osdc device context into the * actual display context. */static void DoUpdate(void){    HDC dc;    dc = BeginPaint(graphicsWindow, &ps);    BitBlt(dc, 0, 0, pixelWidth, pixelHeight, osdc, 0, 0, SRCCOPY);    EndPaint(graphicsWindow, &ps);}/* * Function: DisplayClear * Usage: DisplayClear(); * ---------------------- * This function clears all the bits in the offscreen bitmap. */static void DisplayClear(void){    RECT r;    SetRect(&r, 0, 0, pixelWidth, pixelHeight);    InvalidateRect(graphicsWindow, &r, TRUE);    BitBlt(osdc, 0, 0, pixelWidth, pixelHeight, osdc, 0, 0, WHITENESS);}/* * Function: PrepareToDraw * Usage: PrepareToDraw(); * ----------------------- * This function must be called before any rendering operation * to ensure the pen modes and colors are correctly set. */static void PrepareToDraw(void){    int red, green, blue;    HPEN oldPen;    if (eraseMode) {        (void) SelectObject(osdc, erasePen);        SetTextColor(osdc, eraseColor);    } else {        if (penColor != previousColor) {            red = colorTable[penColor].red * 256 - Epsilon;            green = colorTable[penColor].green * 256 - Epsilon;            blue = colorTable[penColor].blue * 256 - Epsilon;            drawColor = RGB(red, green, blue);            oldPen = drawPen;            drawPen = CreatePen(PS_SOLID, 1, drawColor);            (void) SelectObject(osdc, drawPen);            DeleteObject(oldPen);            previousColor = penColor;        } else {            (void) SelectObject(osdc, drawPen);        }        (void) SetTextColor(osdc, drawColor);    }}/* * Function: DisplayLine * Usage: DisplayLine(x, y, dx, dy); * --------------------------------- * This function renders a line into the offscreen bitmap.  If the * region is started, it adds the line to the developing polygonal * region instead. */static void DisplayLine(double x, double y, double dx, double dy){    int x0, y0, x1, y1;    RECT r;    PrepareToDraw();    x0 = ScaleX(x);    y0 = ScaleY(y);    x1 = ScaleX(x + dx);    y1 = ScaleY(y + dy);    if (regionState == NoRegion) {        SetLineBB(&r, x, y, dx, dy);        InvalidateRect(graphicsWindow, &r, TRUE);        MoveTo(osdc, x0, y0);        LineTo(osdc, x1, y1);    } else {        AddSegment(x0, y0, x1, y1);    }}/* * Function: DisplayArc * Usage: DisplayArc(xc, yc, rx, ry, start, sweep); * ------------------------------------------------ * This function is used to draw an arc.  The arguments are slightly * different from those in the client interface because xc and yc * designate the center.  This function is only called if a region * is not being assembled; if it is, the package calls RenderArc * instead. */static void DisplayArc(double xc, double yc, double rx, double ry,                       double start, double sweep){    RECT r;    int xmax, xmin, ymax, ymin;    int ix0, iy0, ix1, iy1;    PrepareToDraw();    SetArcBB(&r, xc, yc, rx, ry, start, sweep);    InvalidateRect(graphicsWindow, &r, TRUE);    xmin = ScaleX(xc - rx);    ymin = ScaleY(yc + ry);    xmax = xmin + PixelsX(2 * rx);    ymax = ymin + PixelsX(2 * ry);    if (sweep < 0) {        start += sweep;        sweep = -sweep;    }    if (start < 0) {        start = 360 - fmod(-start, 360);    } else {        start = fmod(start, 360);    }    ix0 = ScaleX(xc + rx * cos(Radians(start)));    iy0 = ScaleY(yc + ry * sin(Radians(start)));    ix1 = ScaleX(xc + rx * cos(Radians(start + sweep)));    iy1 = ScaleY(yc + ry * sin(Radians(start + sweep)));    Arc(osdc, xmin, ymin, xmax, ymax, ix0, iy0, ix1, iy1);}/* * Function: RenderArc * Usage: RenderArc(xc, yc, rx, ry, start, sweep); * ----------------------------------------------- * This function is identical to DisplayArc except that, instead * of calling the Arc function, RenderArc simulates the arc by * constructing a path of consecutive segments, which are added * to the current polygonal region. */static void RenderArc(double x, double y, double rx, double ry,                      double start, double sweep){    double t, mint, maxt, dt, maxd;    int ix0, iy0, ix1, iy1;    PrepareToDraw();    if (sweep < 0) {        start += sweep;        sweep = -sweep;    }    if (fabs(rx) > fabs(ry)) {        maxd = fabs(rx);    } else {        maxd = fabs(rx);    }    dt = atan2(InchesY(1), maxd);    mint = Radians(start);    maxt = Radians(start + sweep);    ix0 = ScaleX(x + rx * cos(mint));    iy0 = ScaleY(y + ry * sin(mint));    for (t = mint + dt; t < maxt; t += dt) {        if (t > maxt - dt / 2) t = maxt;        ix1 = ScaleX(x + rx * cos(t));        iy1 = ScaleY(y + ry * sin(t));        AddSegment(ix0, iy0, ix1, iy1);        ix0 = ix1;        iy0 = iy1;    }}/* * Function: DisplayText * Usage: DisplayText(x, y, text); * ------------------------------- * This function displays a text string at (x, y) in the current * font and size.  The hard work is done in DisplayFont. */static void DisplayText(double x, double y, string text){    RECT r;    PrepareToDraw();    SetTextBB(&r, x, y, text);    InvalidateRect(graphicsWindow, &r, TRUE);    SetBkMode(osdc, TRANSPARENT);    TextOut(osdc, ScaleX(x), ScaleY(y) - fontTable[currentFont].ascent,            text, strlen(text));    SetBkMode(osdc, OPAQUE);}/* * Function: DisplayFont * Usage: DisplayFont(font, size, style); * -------------------------------------- * This function updates the font information used for drawing * text.  The program first uses FindExistingFont to see * if the desired font/size pair has been entered in the table, * in which case the program uses the stored handle of the font. * If not, the program uses CreateFont to try to create an * appropriate font, accepting only those whose typeface * matches the desired font string.  If an acceptable font * is found, its data is entered into the font table. */static void DisplayFont(string font, int size, int style){    char fontBuffer[MaxFontName + 1];    char faceName[MaxFontName + 1];    string fontName;    HFONT newFont, oldFont;    TEXTMETRIC metrics;    int i, fontIndex;    for (i = 0; (fontBuffer[i] = tolower(font[i])) != '\0'; i++);    if (StringEqual("default", fontBuffer)) {        fontName = DefaultFont;    } else {        fontName = fontBuffer;    }    fontIndex = FindExistingFont(fontName, size, style);    if (fontIndex == -1) {        newFont =          CreateFont(-size, 0, 0, 0,                     (style & Bold) ? FW_BOLD : FW_NORMAL,                     (style & Italic) != 0,                     0, 0, 0, 0, 0, 0, 0, fontName);        if (newFont != NULL) {            oldFont = (HFONT) SelectObject(osdc, newFont);            GetTextFace(osdc, MaxFontName, faceName);            if (PrefixMatch(fontName, faceName)                && GetTextMetrics(osdc, &metrics)) {                if (nFonts == MaxFonts) Error("Too many fonts loaded");                fontIndex = nFonts++;                fontTable[fontIndex].name = CopyString(fontName);                fontTable[fontIndex].size = size;                fontTable[fontIndex].style = style;                fontTable[fontIndex].font = newFont;                fontTable[fontIndex].ascent = metrics.tmAscent;                fontTable[fontIndex].descent = metrics.tmDescent;                fontTable[fontIndex].height =                  metrics.tmHeight + metrics.tmExternalLeading;                fontTable[fontIndex].points =                  metrics.tmHeight - metrics.tmInternalLeading;                currentFont = fontIndex;                textFont = CopyString(font);                pointSize = fontTable[fontIndex].points;                textStyle = style;            } else {                (void) SelectObject(osdc, oldFont);            }        }    } else {        (void) SelectObject(osdc, fontTable[fontIndex].font);        currentFont = fontIndex;        textFont = CopyString(font);        pointSize = fontTable[fontIndex].points;        textStyle = style;    }}/* * Function: FindExistingFont * Usage: fontIndex = FindExistingFont(name, size, style); * ------------------------------------------------------- * This function searches the font table for a matching font * entry.  The function returns the matching table index or -1 if * no match is found, The caller has already converted the name * to lower case to preserve the case-insensitivity requirement. */static int FindExistingFont(string name, int size, int style){    int i;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91高清视频在线| 久久一夜天堂av一区二区三区| 欧美日韩在线观看一区二区| 欧美成人猛片aaaaaaa| 亚洲女与黑人做爰| 捆绑紧缚一区二区三区视频| 99久久国产综合色|国产精品| 制服丝袜av成人在线看| 中文字幕亚洲成人| 韩国成人精品a∨在线观看| 欧美吻胸吃奶大尺度电影 | 欧美精品免费视频| 中文av一区二区| 欧美aⅴ一区二区三区视频| 色天使色偷偷av一区二区| 欧美激情一区二区三区不卡 | 另类的小说在线视频另类成人小视频在线| 成人手机电影网| 欧美xfplay| 日韩高清电影一区| 在线观看亚洲成人| 亚洲欧美日韩在线不卡| 成人午夜电影小说| 久久久久久久综合日本| 精品一区二区综合| 精品少妇一区二区三区免费观看 | 精品一区二区三区免费播放 | 久久久午夜电影| 久久狠狠亚洲综合| 精品国产一区二区三区忘忧草 | 精品国产凹凸成av人导航| 日韩综合在线视频| 欧美日韩激情在线| 日韩1区2区日韩1区2区| 4438亚洲最大| 蜜桃av一区二区在线观看| 日韩一区二区三区电影在线观看| 日av在线不卡| 久久精品一区蜜桃臀影院| 国产精品一区2区| 欧美国产日韩a欧美在线观看| 国产精品77777竹菊影视小说| 久久久久久久性| 成人丝袜18视频在线观看| 亚洲欧洲制服丝袜| 欧美系列亚洲系列| 日本欧美肥老太交大片| 337p日本欧洲亚洲大胆色噜噜| 九九国产精品视频| 国产精品视频你懂的| 91免费小视频| 午夜影院久久久| 欧美tickle裸体挠脚心vk| 国产一区在线看| 国产精品成人在线观看 | 99视频在线精品| 亚洲一区二区三区影院| 日韩视频在线观看一区二区| 国产成人精品www牛牛影视| 中文字幕一区二区三区四区不卡| 91在线国产福利| 亚洲aaa精品| 久久综合资源网| 色综合久久综合网97色综合| 首页国产丝袜综合| 国产人妖乱国产精品人妖| 色综合色综合色综合| 免费av成人在线| 国产精品久久久久久久午夜片| 在线视频亚洲一区| 国内精品久久久久影院色 | 美女脱光内衣内裤视频久久网站| 久久久久久久久久久久电影| 色一情一乱一乱一91av| 久久se精品一区精品二区| 国产精品久久毛片av大全日韩| 色婷婷久久久亚洲一区二区三区| 美国毛片一区二区三区| 自拍偷拍亚洲综合| 精品处破学生在线二十三| 91传媒视频在线播放| 国产在线精品一区二区| 亚洲最新在线观看| 欧美国产激情二区三区| 欧美一区二区视频在线观看| 色综合天天综合网天天狠天天| 韩国成人精品a∨在线观看| 天天色图综合网| 亚洲自拍偷拍图区| 国产精品久久久久aaaa| 欧美成人官网二区| 欧美性生活久久| 99久久99久久久精品齐齐| 国产精品中文字幕一区二区三区| 亚洲福利一区二区| 亚洲欧美日韩国产中文在线| 日本一区二区免费在线| 欧美电影精品一区二区| 欧美区视频在线观看| 日本久久精品电影| 99热99精品| 成人免费看的视频| 国产精品羞羞答答xxdd| 久久国产精品99久久久久久老狼| 亚洲成在人线在线播放| 一区2区3区在线看| 亚洲欧美国产毛片在线| 中文字幕一区二区三区蜜月 | 一级做a爱片久久| 国产精品护士白丝一区av| 国产亚洲精品免费| 久久色在线观看| 精品99一区二区| 亚洲精品一线二线三线无人区| 欧美一二三在线| 日韩精品在线看片z| 日韩欧美123| 欧美精品一区二区三区蜜桃| 精品国产亚洲在线| 久久这里只有精品首页| 精品蜜桃在线看| 久久久一区二区| 国产欧美日韩久久| 国产精品久久福利| 一区二区三区日韩欧美精品| 一区二区三区四区高清精品免费观看| 一区二区三区久久| 亚洲成av人片在线观看| 蜜臀av性久久久久蜜臀aⅴ| 久久不见久久见中文字幕免费| 国产原创一区二区| jizz一区二区| 欧美午夜宅男影院| 精品免费视频.| 国产精品网站在线观看| 亚洲免费av在线| 日韩成人一级大片| 国产成人激情av| 欧美午夜精品久久久久久超碰 | 色噜噜久久综合| 欧美美女网站色| 久久精品一二三| 亚洲欧洲制服丝袜| 秋霞电影一区二区| 国产suv一区二区三区88区| 91美女视频网站| 6080午夜不卡| 中文字幕成人av| 亚洲国产裸拍裸体视频在线观看乱了 | 亚洲3atv精品一区二区三区| 精品在线免费视频| 99久久综合国产精品| 欧美日本免费一区二区三区| 精品88久久久久88久久久| 国产欧美日韩久久| 日韩成人伦理电影在线观看| 国产麻豆精品theporn| 一本色道久久综合亚洲aⅴ蜜桃| 日韩西西人体444www| 中文字幕日本不卡| 免费在线成人网| 色综合久久久久综合体桃花网| 宅男在线国产精品| 国产精品久久久久三级| 蜜臀国产一区二区三区在线播放| eeuss影院一区二区三区 | 国产精品毛片大码女人| 日韩精品免费专区| 99久久精品久久久久久清纯| 日韩欧美一区二区久久婷婷| 亚洲欧美激情插| 国产成人亚洲综合a∨婷婷| 91精品国产入口在线| 一区二区三区在线观看欧美| 国产v综合v亚洲欧| 日韩视频一区二区三区 | 国产原创一区二区| 欧美绝品在线观看成人午夜影视| 自拍偷拍亚洲综合| 国产精品中文有码| 精品999久久久| 免费一区二区视频| 欧美日韩高清一区二区不卡| 亚洲人一二三区| 99视频国产精品| 国产欧美一区二区三区在线看蜜臀 | 欧美国产日本韩| 蜜桃精品在线观看| 欧美精品色一区二区三区| 亚洲精品日韩专区silk| 成人av在线网站| 欧美高清在线一区二区| 狠狠色丁香九九婷婷综合五月| 欧美一区二区三区婷婷月色| 亚洲一区在线观看网站| 在线免费视频一区二区| 曰韩精品一区二区| 91在线观看高清| 一区二区三区在线免费播放| 欧美亚洲综合另类|