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

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

?? graphicfunctions.cpp

?? windows mobile 下的聯(lián)系人管理工具。類是iphone的滑動(dòng)聯(lián)系人功能
?? CPP
字號(hào):
#include "stdafx.h"
#include "GraphicFunctions.h"

HFONT BuildFont(int iFontSize, BOOL bBold, BOOL bItalic) {
	LOGFONT lf;
	memset(&lf, 0, sizeof(LOGFONT));

	lf.lfHeight = iFontSize;
	lf.lfWidth = 0;
	lf.lfEscapement = 0;
	lf.lfOrientation = 0;
	lf.lfWeight = bBold ? 600 : 500;
	lf.lfItalic = bItalic;
	lf.lfUnderline = false;
	lf.lfStrikeOut = false;
	lf.lfCharSet = EASTEUROPE_CHARSET;
	lf.lfOutPrecision = OUT_RASTER_PRECIS;
	lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
	lf.lfQuality = CLEARTYPE_QUALITY;
	lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
	_tcsncpy (lf.lfFaceName, TEXT("Tahoma"), LF_FACESIZE);
	//lf.lfFaceName[LF_FACESIZE-1] = L'\0';  // Ensure null termination
	return CreateFontIndirect(&lf);
}

void DrawGradientGDI(HDC tdc, RECT iRect, 
				     COLORREF StartRGB, COLORREF EndRGB) {
					 
	unsigned int Shift = 8;
	TRIVERTEX        vert[2] ;
	GRADIENT_RECT    gRect;
	vert [0] .x      = iRect.left;
	vert [0] .y      = iRect.top;
	vert [0] .Red    = GetRValue(StartRGB) << Shift;
	vert [0] .Green  = GetGValue(StartRGB) << Shift;
	vert [0] .Blue   = GetBValue(StartRGB) << Shift;
	vert [0] .Alpha  = 0x0000;
	vert [1] .x      = iRect.right;
	vert [1] .y      = iRect.bottom; 
	vert [1] .Red    = GetRValue(EndRGB) << Shift;
	vert [1] .Green  = GetGValue(EndRGB) << Shift;
	vert [1] .Blue   = GetBValue(EndRGB) << Shift;
	vert [1] .Alpha  = 0x0000;
	gRect.UpperLeft  = 0;
	gRect.LowerRight = 1;
	GradientFill(tdc, vert, 2, &gRect, 1, GRADIENT_FILL_RECT_V);
}

void BltAlpha(HDC hdcDest, int nXOriginDest, int nYOriginDest,
              int nWidthDest, int nHeightDest,
              HDC hdcSrc, int nXOriginSrc, int nYoriginSrc,
              int nWidthSrc, int nHeightSrc,
              BYTE alpha) {

	BLENDFUNCTION bf;
	bf.BlendOp = AC_SRC_OVER;
	bf.BlendFlags = 0;
	bf.SourceConstantAlpha = alpha;
	bf.AlphaFormat = 0;
	AlphaBlend(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, 
		hdcSrc, nXOriginSrc, nYoriginSrc, nWidthSrc, nHeightSrc, bf);
}

void BltAlpha(HDC hdcDest, int nLeft, int nTop, int nWidth, int nHeight, 
			  HDC hdcSrc, BYTE alpha) {

    BltAlpha(hdcDest, nLeft, nTop, nWidth, nHeight, 
		hdcSrc, 0, 0, nWidth, nHeight, alpha);
}

// **************************************************************************
// Function Name: GetStreamSize
// 
// Purpose: Given an IStream, returns the size of the stream.  This is needed
//          for streams that do not support the Stat method
//
// Arguments:
//    IN  IStream*  pStream - stream to determine size for
//    OUT ULONG*    pulSize - size of stream
//
// Return Values:
//    HRESULT - S_OK if success, failure code if not
//
// Side Effects:
//    The stream pointer always resets to the beginning
//

HRESULT GetStreamSize(IStream* pStream, ULONG* pulSize)
{
    HRESULT hr;
    LARGE_INTEGER  li = {0};
    ULARGE_INTEGER uliZero = {0};
    ULARGE_INTEGER uli;

    CBR(pStream != NULL && pulSize != NULL);

    hr = pStream->Seek(li, STREAM_SEEK_END, &uli);
    CHR(hr);

    *pulSize = uli.LowPart;
    hr = S_OK;

Error:
    if (SUCCEEDED(hr))
    {
        // Move the stream back to the beginning of the file
        hr = pStream->Seek(li, STREAM_SEEK_SET, &uliZero);
    }

    return hr;
}

// **************************************************************************
// Function Name: ScaleProportional
// 
// Purpose: Scale the width and height to fit the given width and height
//          but maintain the proportion
//
// Arguments:
//    IN     UINT  uFitToWidth     - width of source image
//    IN     UINT  uFitToHeight    - height of source image
//    IN/OUT UINT* puWidthToScale  - width of image to scale to
//    IN/OUT UINT* puHeightToScale - height of image to scale to
//
// Return Values:
//    HRESULT - S_OK if success, failure code if not
//
void ScaleProportional(UINT uFitToWidth, UINT uFitToHeight, 
                       UINT *puWidthToScale, UINT *puHeightToScale) {
    HRESULT hr;

    CBR(puWidthToScale != NULL && puHeightToScale != NULL);

    // Scale (*puWidthToScale, *puHeightToScale) to fit within (uFitToWidth, uFitToHeight), while
    // maintaining the aspect ratio
    int nScaledWidth = MulDiv(*puWidthToScale, uFitToHeight, *puHeightToScale);

    // If we didn't overflow and the scaled width does not exceed bounds
    if (nScaledWidth >= 0 && nScaledWidth <= (int)uFitToWidth)
    {
        *puWidthToScale  = nScaledWidth;
        *puHeightToScale = uFitToHeight;
    }
    else
    {
        *puHeightToScale = MulDiv(*puHeightToScale, uFitToWidth, *puWidthToScale);
        
        // The height *must* be within the bounds [0, uFitToHeight] since we overflowed
        // while fitting to height
        ASSERT(*puHeightToScale >= 0 && *puHeightToScale <= uFitToHeight);
        
        *puWidthToScale  = uFitToWidth;
    }

Error:
    return;
}

// **************************************************************************
// Function Name: HBITMAPFromImage
// 
// Purpose: Convert IImage to HBITMAP.  If bitmap has transparency, the
//    background will be filled with the color passed in
//
// Arguments:
//    IN  IImage*   pImage      - pointer to the IImage
//    IN  COLORREF  crBackColor - color of the background
//
// Return Values:
//    HRESULT - S_OK if success, failure code if not
//
HBITMAP HBITMAPFromImage (IN IImage * pImage, IN COLORREF crBackColor) {

    HRESULT    hr;
    HBITMAP    hbmResult = NULL;
    ImageInfo  ii;
    HDC        hDC = NULL;
    HBITMAP    hbmNew = NULL;
    void *     pv;
    BITMAPINFO bmi = { 0 };
    HBITMAP    hbmOld = NULL;
    RECT       rc = { 0 };

    CBR(pImage != NULL);

    // Get image width/height
    hr = pImage->GetImageInfo(&ii);
    CHR(hr);

    // Create HDC
    hDC = CreateCompatibleDC(NULL);
    CBR(hDC != NULL);

    // Create DIB section
    bmi.bmiHeader.biSize        = sizeof(BITMAPINFOHEADER);
    bmi.bmiHeader.biWidth       = ii.Width;
    bmi.bmiHeader.biHeight      = ii.Height;
    bmi.bmiHeader.biPlanes      = 1;
    bmi.bmiHeader.biBitCount    = (SHORT) max(16, GetDeviceCaps(hDC, BITSPIXEL));
    bmi.bmiHeader.biCompression = BI_RGB;

    hbmNew = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pv, NULL, 0);
    CBR(hbmNew != NULL);

    // Select DIB into DC
    hbmOld = (HBITMAP)SelectObject(hDC, hbmNew);

    rc.right = ii.Width;
    rc.bottom = ii.Height;

    // Clear the bitmap using the background color
    DrawRect(hDC, &rc, crBackColor); 

    // Draw into DC/DIB
    hr = pImage->Draw(hDC, &rc, NULL);
    CHR(hr);

    hbmResult = hbmNew;
    hbmNew = NULL;

Error:
    if (hbmNew)
    {
        DeleteObject(hbmNew);       
    }

    if (hDC)
    {
        if (hbmOld)
        {
            SelectObject(hDC, hbmOld);
        }

        DeleteDC(hDC);
    }

    return hbmResult;
}

// **************************************************************************
// Function Name: GetBitmapFromStream
// 
// Purpose: Convert an IStream to an HBITMAP and return the new dimensions
//
// Arguments:
//    IN     UINT  uFitToWidth     - width of source image
//    IN     UINT  uFitToHeight    - height of source image
//    OUT UINT* puWidth  - width of image to scale to
//    OUT UINT* puHeight - height of image to scale to
//
// Return Values:
//    HRESULT - S_OK if success, failure code if not
//
HRESULT GetBitmapFromStream(IStream* pStream, HBITMAP* phBitmap, 
    UINT* puWidth, UINT* puHeight) {

    HRESULT hr;
    HBITMAP           hBitmap = NULL;

    IImagingFactory*  pFactory = NULL;
    IImage*           pImage   = NULL;
    IImage*           pThumbnail = NULL;
    ImageInfo         imgInfo = {0};

    CBR(pStream != NULL && phBitmap != NULL && puWidth != NULL && puHeight != NULL);

    // Use a little imaging help
    hr = CoCreateInstance(CLSID_ImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IImagingFactory, (void**) &pFactory);
    CHR(hr);
    
    hr = pFactory->CreateImageFromStream(pStream, &pImage);
    CHR(hr);

    hr = pImage->GetImageInfo(&imgInfo);
    CHR(hr);
    CBR(imgInfo.Width > 0 && imgInfo.Height > 0);

    // Scale to the new size
    ScaleProportional(*puWidth, *puHeight, &imgInfo.Width, &imgInfo.Height);

    // Get the new image
    hr = pImage->GetThumbnail(imgInfo.Width, imgInfo.Height, &pThumbnail);
    CHR(hr);

    // Convert this to HBITMAP, our target format
    hBitmap = HBITMAPFromImage(pThumbnail, RGB(255,255,255));
    CBR(hBitmap != NULL);

    *puWidth = imgInfo.Width;
    *puHeight = imgInfo.Height;
    *phBitmap = hBitmap;
    hBitmap = NULL;

Error:
    RELEASE_OBJ(pFactory);
    RELEASE_OBJ(pImage);
    RELEASE_OBJ(pThumbnail);

    if (hBitmap)
    {
        DeleteObject((HGDIOBJ)(HBITMAP)(hBitmap));
    }

    return hr;

}

// **************************************************************************
// Function Name: DrawRect
// 
// Purpose: Draws a rectangle with the coordinates and the color passed in
//
// Arguments:
//    IN HDC      hdc - DC for drawing
//    IN LPRECT   prc - Area to draw the rectangle
//    IN COLORREF clr - color to draw the rectangle
//
// Return Values:
//    NONE
//

void DrawRect(HDC hdc, LPRECT prc, COLORREF clr) {
    COLORREF clrSave = SetBkColor(hdc, clr);
    ExtTextOut(hdc,0,0,ETO_OPAQUE,prc,NULL,0,NULL);
    SetBkColor(hdc, clrSave);
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品电影在线播放| 亚洲最新在线观看| 久久er99精品| 亚洲午夜精品在线| 一区二区三区电影在线播| 国产精品久久久久久久久动漫 | 国产精品免费aⅴ片在线观看| 日韩欧美另类在线| 欧美一级一区二区| 欧美一区二区三区精品| 欧美日本国产一区| 欧美一区日本一区韩国一区| 欧美日韩成人综合天天影院| 欧美精品亚洲一区二区在线播放| 欧美日韩在线三区| 欧美剧在线免费观看网站| 7777精品久久久大香线蕉| 欧美美女一区二区| 日韩三级视频在线观看| www国产亚洲精品久久麻豆| 欧美精品一区二区在线观看| 久久美女高清视频| 国产欧美日韩亚州综合| 国产精品毛片久久久久久| 亚洲天堂2016| 亚洲一区在线看| 日韩精品乱码av一区二区| 美腿丝袜一区二区三区| 国产一区二区视频在线| 成人午夜免费av| 国产真实乱子伦精品视频| 久久久久久久久久久99999| 欧美国产一区视频在线观看| 亚洲欧美一区二区在线观看| 一区二区不卡在线视频 午夜欧美不卡在 | 色av成人天堂桃色av| 精品视频在线视频| 精品国产不卡一区二区三区| 国产1区2区3区精品美女| 午夜精品久久久久久久久| 亚洲午夜久久久久久久久电影网| 性做久久久久久免费观看欧美| 一区二区欧美视频| 日本中文在线一区| 久久国产人妖系列| 粉嫩在线一区二区三区视频| 久久9热精品视频| 日韩欧美在线观看一区二区三区| 欧美成人一区二区三区片免费| 久久久天堂av| 一区二区三区日韩欧美精品| 美女任你摸久久| 福利一区二区在线观看| 91福利小视频| 亚洲精品一区二区三区影院 | 久久综合成人精品亚洲另类欧美| 亚洲欧美中日韩| 日韩精品免费视频人成| 国产91综合一区在线观看| 亚洲同性gay激情无套| 欧美三级电影网| 精品裸体舞一区二区三区| 1000精品久久久久久久久| 日本欧洲一区二区| 波多野结衣中文一区| 日韩三级精品电影久久久| 中文字幕综合网| 精品一区二区成人精品| 91成人免费在线视频| 久久久亚洲午夜电影| 亚洲国产精品久久久久婷婷884| 国产一区二区三区| 欧美日韩一级黄| 国产精品国产三级国产aⅴ中文| 免费久久99精品国产| 色香色香欲天天天影视综合网| 日韩免费电影一区| 亚洲一区二区三区影院| 成人a级免费电影| 欧美精品一区二区不卡| 一级女性全黄久久生活片免费| 国产不卡一区视频| 日韩免费看的电影| 午夜视频在线观看一区| 北条麻妃一区二区三区| 精品国精品国产| 石原莉奈一区二区三区在线观看| 99国产精品久| 中文成人综合网| 国内国产精品久久| 欧美一级日韩免费不卡| 亚洲精品成人精品456| 成人精品在线视频观看| 日韩一区二区不卡| 亚洲精品福利视频网站| 9人人澡人人爽人人精品| 久久先锋影音av鲁色资源| 成人av在线网站| 91麻豆精品久久久久蜜臀| 综合婷婷亚洲小说| 懂色av中文字幕一区二区三区| 日韩美女天天操| 亚洲成人在线网站| 欧美午夜精品电影| 亚洲一区在线观看网站| 色av成人天堂桃色av| 有码一区二区三区| 色婷婷久久久综合中文字幕| 亚洲三级在线播放| 99re66热这里只有精品3直播| 国产精品三级av| 成人av小说网| 亚洲色图视频免费播放| 91小视频免费观看| 亚洲综合色在线| 欧美视频在线不卡| 丝袜国产日韩另类美女| 91精品国产一区二区三区| 日韩制服丝袜先锋影音| 欧美一区二区大片| 精品一区二区三区的国产在线播放| 91精品福利在线一区二区三区| 日本大胆欧美人术艺术动态| 日韩三级高清在线| 国产精品538一区二区在线| 国产亚洲欧美激情| 成年人午夜久久久| 亚洲视频一区在线| 欧美日韩一区视频| 麻豆高清免费国产一区| 久久视频一区二区| av电影天堂一区二区在线观看| 亚洲免费观看高清完整版在线观看 | 欧美日本不卡视频| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 国产精品国产精品国产专区不片| 99久久久久免费精品国产| 一区二区三区中文字幕在线观看| 欧美三级电影网| 国精品**一区二区三区在线蜜桃| 久久你懂得1024| 91丨九色丨蝌蚪丨老版| 天天综合色天天| 国产色综合久久| 在线免费观看日韩欧美| 蜜桃久久精品一区二区| 中文字幕精品一区| 91传媒视频在线播放| 国产最新精品精品你懂的| 亚洲欧美自拍偷拍| 日韩丝袜情趣美女图片| 成人性生交大片免费看视频在线| 亚洲激情自拍偷拍| 亚洲精品一区二区三区蜜桃下载| 99re这里都是精品| 麻豆精品视频在线| 中文字幕在线观看一区| 欧美日韩在线精品一区二区三区激情| 蜜桃视频第一区免费观看| 国产精品无遮挡| 欧美精品视频www在线观看 | 丁香桃色午夜亚洲一区二区三区| 国产校园另类小说区| 在线视频中文字幕一区二区| 午夜成人在线视频| 国产日韩高清在线| 欧美亚州韩日在线看免费版国语版| 久久草av在线| 国产精品无圣光一区二区| 欧美一区二区在线免费播放| 久久国产精品无码网站| 久久精品国产第一区二区三区| 国产日韩精品一区二区三区在线| 91福利视频网站| 懂色av一区二区三区免费观看| 亚洲一区二区三区小说| 精品国产百合女同互慰| 欧美日韩激情在线| 国产一区二区三区免费| 午夜精品123| 欧美高清一级片在线观看| 欧美一区二区三区公司| 91在线视频官网| 大胆欧美人体老妇| 日韩电影在线观看电影| 一区二区三区在线观看视频 | 欧美精品久久一区二区三区| 成人18精品视频| 免费成人小视频| 一区二区三区精品在线| 久久亚洲精品小早川怜子| 欧美一区二区三区在线电影| 99精品视频在线播放观看| 国产精品一区二区在线观看不卡 | 亚洲福利视频一区| 亚洲欧洲精品一区二区三区| 777奇米成人网| 精品视频在线免费| 国产91精品免费| 国产精品亚洲成人|