当前位置: 首页>>代码示例>>C++>>正文


C++ Bitmap::GetHeight方法代码示例

本文整理汇总了C++中Bitmap::GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ Bitmap::GetHeight方法的具体用法?C++ Bitmap::GetHeight怎么用?C++ Bitmap::GetHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bitmap的用法示例。


在下文中一共展示了Bitmap::GetHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnDraw

void CBMPView::OnDraw(CDC* pDC)
{
    Graphics graphicsDC(*pDC);					// gdi+ 그리기를 위한 객체
    CRect clientRect;
    GetClientRect(clientRect);
    Bitmap bmpCanvas(clientRect.right, clientRect.bottom);	// 캔버스 비트맵 생성
    Graphics graphicsCanvas(&bmpCanvas);		// 캔버스 그래픽스 생성
    graphicsCanvas.Clear(Color::Azure);			// 캔버스 배경색 지정

    CBMPDoc *pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    if (!pDoc)
        return;

    // TODO: 여기에 그리기 코드를 추가합니다.
    Bitmap* pBitmap = pDoc->m_bitmap;
    UINT gapW = abs(clientRect.Width() - (int)pBitmap->GetWidth());
    UINT gapH = abs(clientRect.Height() - (int)pBitmap->GetHeight());
    UINT gap = gapW > gapH ? gapW : gapH;

    if (pBitmap) {
        graphicsCanvas.DrawImage(pBitmap, 0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
    }

    graphicsDC.DrawImage(&bmpCanvas, clientRect.left, clientRect.top, clientRect.right, clientRect.bottom);	// 캔버스 그리기
}
开发者ID:Leehwajung,项目名称:ImagePointProcessor,代码行数:26,代码来源:BMPView.cpp

示例2: createCircle

void MarkerTool::createCircle()
{
    using namespace Gdiplus;
    delete[] circleData_;
    circleData_ = 0;
    circleStride_ = 0;
    Bitmap * circle = new Bitmap(penSize_, penSize_, PixelFormat32bppARGB);
    Graphics gr2(circle);
    SolidBrush br(Color(255,255,0));
    gr2.FillEllipse( &br, 0, 0, circle->GetWidth(), circle->GetHeight());

    BitmapData circleData;

    Rect lc(0,0,circle->GetWidth(),circle->GetHeight());
    if ( circle->LockBits(&lc, ImageLockModeRead, PixelFormat32bppARGB, & circleData) == Ok)
    {
        if (circleData.Stride > 0) { 
            circleStride_ = circleData.Stride;
        } else {
            circleStride_ = - circleData.Stride;
        }
        size_t dataSize = circleStride_ * circle->GetHeight();
        circleData_ = new uint8_t[dataSize];
        memcpy(circleData_, circleData.Scan0, dataSize);
        circle->UnlockBits(&circleData);
    }
    
    delete circle;
}
开发者ID:vladios13,项目名称:image-uploader,代码行数:29,代码来源:MarkerTool.cpp

示例3: GPCreateFlashFrame

void GPCreateFlashFrame( Bitmap& bmpSrc, CRect& rcBegin, CRect& rcEnd, Bitmap& bmpDes, CRect& rcDes, double dPercent )
{
    int  nWidth = bmpSrc.GetWidth();
    int  nHeight = bmpSrc.GetHeight();
    double dPercent2 = 1.0 - dPercent;
    int  nWidthDes = bmpDes.GetWidth();
    int  nHeightDes = bmpDes.GetHeight();
    CRect rcBmpSrc(0,0, nWidth, nHeight);
    CRect rcBmpDes(0,0, nWidthDes, nHeightDes);

    ASSERT(IsInRect(rcBegin, rcBmpSrc));
    ASSERT(IsInRect(rcEnd, rcBmpSrc));
    ASSERT(IsInRect(rcDes, rcBmpDes));
    ASSERT(rcBegin.Size() == rcEnd.Size());
    ASSERT(rcEnd.Size() == rcDes.Size());
    int nLoopWidth = rcBegin.Width();
    int nLoopHeight = rcBegin.Height();
    for (int i = 0; i <nLoopWidth; i++)
    {
        for (int j = 0; j < nLoopHeight; j++)
        {
            Color clrBegin;
            bmpSrc.GetPixel(i+ rcBegin.left, j+ rcBegin.top, &clrBegin);
            Color clrEnd;
            bmpSrc.GetPixel(i+ rcEnd.left, j+ rcEnd.top, &clrEnd);
            Color clrDes = Color::MakeARGB(clrBegin.GetA()*dPercent + clrEnd.GetA()* dPercent2, 
                clrBegin.GetR()*dPercent + clrEnd.GetR()* dPercent2,
                clrBegin.GetG()*dPercent + clrEnd.GetG()* dPercent2,
                clrBegin.GetB()*dPercent + clrEnd.GetB()* dPercent2);
            bmpDes.SetPixel(rcDes.left + i, rcDes.top+j, clrDes);
        }
    }
    

}
开发者ID:tianyx,项目名称:TxUIProject,代码行数:35,代码来源:GDIDrawFunc.cpp

示例4: RawSaveScreen

// RawSaveScreen: copy the current screen to a backup bitmap
void RawSaveScreen () {
    if (raw_saved_screen != NULL)
        delete raw_saved_screen;
    Bitmap *source = thisroom.ebscene[play.bg_frame];
    raw_saved_screen = BitmapHelper::CreateBitmap(source->GetWidth(), source->GetHeight());
    raw_saved_screen->Blit(source, 0, 0, 0, 0, source->GetWidth(), source->GetHeight());
}
开发者ID:Cheeseness,项目名称:ags,代码行数:8,代码来源:global_drawingsurface.cpp

示例5: Paint

// OrGate 메시지 처리기입니다.
void OrGate::Paint(CClientDC* dc) {
    /*
    CBitmap bitmap;
    bitmap.LoadBitmapW(IDB_OR);
    BITMAP bmpinfo;
    bitmap.GetBitmap(&bmpinfo);

    CDC dcmem;
    dcmem.CreateCompatibleDC(dc);
    dcmem.SelectObject(&bitmap);

    dc->BitBlt(point.x, point.y, bmpinfo.bmWidth, bmpinfo.bmHeight, &dcmem, 0, 0, SRCCOPY);
*/

/* GDI+ 구현 */
    Graphics ScreenG(dc->GetSafeHdc());
    Bitmap* pBitmapOR;
    pBitmapOR = Bitmap::FromResource(AfxGetInstanceHandle(), (WCHAR*)MAKEINTRESOURCE(IDB_OR));

    ScreenG.DrawImage(pBitmapOR, Rect(point.x, point.y, pBitmapOR->GetWidth(), pBitmapOR->GetHeight()), 0, 0, pBitmapOR->GetWidth(), pBitmapOR->GetHeight(), UnitPixel);


    Width = pBitmapOR->GetWidth();
    Height = pBitmapOR->GetHeight();

    //연결 구현
    if (UpWire == point.x + 3 && UpWire == point.y + 7 && DownWire == point.x + 3 && DownWire == point.y + 19) { // ORGate와 선 연결 성공
        connect = TRUE;
    }
}
开发者ID:phy0110,项目名称:LogicSimulator_MFC,代码行数:31,代码来源:OrGate.cpp

示例6: DrawBitmap

void DrawBitmap(Bitmap &b, Rect& rect, int x, int y)
{
    glPushMatrix();
    glTranslatef((float)x,(float)y,0);
    ////enable textures and set up automatic texture coordinate generation
    glBindTexture(GL_TEXTURE_2D, b.GetTexture());  
    glEnable(GL_TEXTURE_2D);

    glColor4f(1.0f,1.0f,1.0f,1.0f);

    //Define how alpha blending will work and enable alpha blending.
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_BLEND);

    float tx1 = min(1.0f, (float)rect.X / (float)b.GetWidth());
    float ty1 = min(1.0f, (float)rect.Y / (float)b.GetHeight());

    float q = ((float)(rect.Width)/((float)b.GetWidth()));
    float tx2 = min(1.0f, tx1 + q);

    float f = (float)(rect.Height)/((float)b.GetHeight());
    float ty2 = min(1.0f, (ty1 + f) );



    glPolygonMode(GL_FRONT_AND_BACK, GL_POLYGON);
    glBegin(GL_QUADS);
            glTexCoord2f(tx1, 1-ty1); glVertex2f(0.0f, 0.0f);
            glTexCoord2f(tx1, 1-ty2); glVertex2f(0.0f, (float)rect.Height);
            glTexCoord2f(tx2, 1-ty2); glVertex2f((float)rect.Width, (float)rect.Height);
            glTexCoord2f(tx2, 1-ty1); glVertex2f((float)rect.Width, 0.0f);
    glEnd();
    glDisable(GL_TEXTURE_2D);
    glPopMatrix();
}
开发者ID:ngn15002,项目名称:DVA222_Projekt2,代码行数:35,代码来源:Graphix.cpp

示例7: show_preload

void show_preload () {
    // ** Do the preload graphic if available
    color temppal[256];
    Bitmap *splashsc = BitmapHelper::CreateRawObjectOwner( load_pcx("preload.pcx",temppal) );
    if (splashsc != NULL) {
        if (splashsc->GetColorDepth() == 8)
            wsetpalette(0,255,temppal);
        Bitmap *screen_bmp = BitmapHelper::GetScreenBitmap();
        Bitmap *tsc = BitmapHelper::CreateBitmap(splashsc->GetWidth(),splashsc->GetHeight(),screen_bmp->GetColorDepth());
        tsc->Blit(splashsc,0,0,0,0,tsc->GetWidth(),tsc->GetHeight());
        screen_bmp->Clear();
        screen_bmp->StretchBlt(tsc, RectWH(0, 0, scrnwid,scrnhit), Common::kBitmap_Transparency);

        gfxDriver->ClearDrawList();

        if (!gfxDriver->UsesMemoryBackBuffer())
        {
            IDriverDependantBitmap *ddb = gfxDriver->CreateDDBFromBitmap(screen_bmp, false, true);
            gfxDriver->DrawSprite(0, 0, ddb);
            render_to_screen(screen_bmp, 0, 0);
            gfxDriver->DestroyDDB(ddb);
        }
        else
            render_to_screen(screen_bmp, 0, 0);

        delete splashsc;
        delete tsc;
        platform->Delay(500);
    }
}
开发者ID:jdiperla,项目名称:ags,代码行数:30,代码来源:engine.cpp

示例8: Run

// Run()
void Run()
{
    HDC backDC = backBuf.GetDC();
    
    // 塗りつぶし
    RECT rc;
    rc.left = rc.top = 0;
    rc.right = backBuf.GetWidth();
    rc.bottom = backBuf.GetHeight();

    FillRect(backDC, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));

    // 図形描画
    HPEN hPenOld, hPen;

    hPen = CreatePen(PS_SOLID, 0, RGB(0xff, 0, 0));
    hPenOld = (HPEN)SelectObject(backDC, hPen);
    
    Vector2 r[4];
    Vector2 trans(backBuf.GetWidth()>>1, backBuf.GetHeight()>>1);
    Matrix2 rot, sc;
    static int t = 0;
    t += 5;
    Matrix2Rotation(rot, t/180.0f*3.14);
    Matrix2Scaling(sc, 2, 2);
    for (int i = 0; i < 4; ++i) {
        r[i] = rect[i] * sc * rot;
        r[i] = r[i] + trans;
    }
        /*Vector3 r[4];
        Vector3 trans(backBuf.GetWidth()>>1, backBuf.GetHeight()>>1, 0);
        Matrix3 rot, sc;
        static int t = 0;
        t += 5;
        Matrix3RotationHV(rot, t/180.0f*3.14);
        for (int i = 0; i < 4; ++i) {
            r[i].x = rect[i].x;
            r[i].y = rect[i].y;
            r[i] = r[i] * rot;
            r[i] = r[i] + trans;
        }*/
    for (int i = 0; i < 4; ++i) {
        MoveToEx(backDC, r[i].x, r[i].y, NULL);
        LineTo(backDC, r[(i+1)&3].x, r[(i+1)&3].y);
    }
    SelectObject(backDC, hPenOld);
    DeleteObject(hPen);
    

    // フリップ
    HDC hDC = GetDC(wnd.GetHandle());
    BitBlt(hDC, 0, 0, rc.right, rc.bottom, backDC, 0, 0, SRCCOPY);
    ReleaseDC(wnd.GetHandle(), hDC);

    Sleep(100);
}
开发者ID:erio-nk,项目名称:MyCxxProgram2011,代码行数:57,代码来源:Test.cpp

示例9: glGenTextures

Texture::Texture(const Bitmap& bmp){
    glGenTextures(1, &id);
    //glBindTexture(GL_TEXTURE_2D, id);
    Bind();
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bmp.GetWidth(), bmp.GetHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, bmp.GetData());
    this->width = bmp.GetWidth();
    this->height = bmp.GetHeight();
    cout << "Texture " << id << endl;
}
开发者ID:caidongyun,项目名称:SE,代码行数:13,代码来源:Texture.cpp

示例10: r

static FtkBitmap* load_win32 (const char *filename)
{
    int x = 0;
    int y = 0;
    int w = 0;
    int h = 0;
    FtkColor bg = {0};
    FtkBitmap* bitmap = NULL;
    WCHAR wfilename[MAX_PATH] = {0};
    mbstowcs(wfilename, filename, MAX_PATH);
    Bitmap* img = Bitmap::FromFile(wfilename);

    return_val_if_fail(img != NULL, NULL);
    if(img->GetWidth() == 0 || img->GetHeight() == 0)
    {
        delete img;

        return NULL;
    }

    w = img->GetWidth();
    h = img->GetHeight();

    bg.a = 0xff;
    bitmap = ftk_bitmap_create(w, h, bg);
    Rect r(0, 0, w, h);
    BitmapData bitmapData;
#ifdef VC6
    img->LockBits(r, ImageLockModeRead, PixelFormat32bppARGB, &bitmapData);
#else
    img->LockBits(&r, ImageLockModeRead, PixelFormat32bppARGB, &bitmapData);
#endif
    FtkColor* src = (FtkColor*)bitmapData.Scan0;
    FtkColor* dst = ftk_bitmap_bits(bitmap);

    for(y = 0; y < h; y++)
    {
        for(x = 0; x < w; x++)
        {
            *dst = *src;
            dst++;
            src++;
        }
    }

    img->UnlockBits(&bitmapData);
    
    delete img;

    return bitmap;
}
开发者ID:htbegin,项目名称:pyftk,代码行数:51,代码来源:ftk_image_win32_decoder.cpp

示例11: GetFaceRect

bool CExampleDemoDlg::GetFaceRect(Bitmap* pImageSori)
{
    //_sleep(100);
    Bitmap* pImageS = pImageSori->Clone(0, 0, pImageSori->GetWidth(), pImageSori->GetHeight(), PixelFormat32bppARGB);
    // TODO:  在此添加您专用的创建代码
    float scalew = 1.;
    if (pImageS->GetWidth() > 480 || pImageS->GetHeight() > 640)
    {

        scalew=min(480.f / pImageS->GetWidth(), 640.f / pImageS->GetHeight());

        int width = pImageS->GetWidth()*scalew;
        int height = pImageS->GetHeight()*scalew;
        ResizeBitmap(&pImageS, width, height);
    }


    Gdiplus::BitmapData TempBitmapData;
    Gdiplus::Rect rc(0, 0, pImageS->GetWidth(), pImageS->GetHeight());
    pImageS->LockBits(&rc, Gdiplus::ImageLockModeRead | Gdiplus::ImageLockModeWrite, PixelFormat32bppARGB, &TempBitmapData);


    CPupilGUI cpi = CPupilGUI((BYTE*)TempBitmapData.Scan0, TempBitmapData.Width, TempBitmapData.Height);
    pImageS->UnlockBits(&TempBitmapData);
    SAFE_DELETE(pImageS);
    if (cpi.isface == true)
    {
        int x0=cpi.m_face_detection.rFace.left;
        int y0 = cpi.m_face_detection.rFace.top;
        int width = (cpi.m_face_detection.rFace.right-x0)/scalew;
        int height = (cpi.m_face_detection.rFace.bottom-y0)/scalew;
        if (height+width<700)
        {
            return false;
        }
        else
        {
            return true;
        }
        //return GetRect(CRect(x0/scalew, y0/scalew, width/scalew, height/scalew), pImageSori);

    }
    else
    {
        return false;
    }



}
开发者ID:hjimce,项目名称:EyeLabelDemo,代码行数:50,代码来源:ExampleDemoDlg.cpp

示例12: DrawingSurface_DrawSurface

void DrawingSurface_DrawSurface(ScriptDrawingSurface* target, ScriptDrawingSurface* source, int translev) {
    if ((translev < 0) || (translev > 99))
        quit("!DrawingSurface.DrawSurface: invalid parameter (transparency must be 0-99)");

    target->StartDrawing();
    Bitmap *surfaceToDraw = source->GetBitmapSurface();

    if (surfaceToDraw == abuf)
        quit("!DrawingSurface.DrawSurface: cannot draw surface onto itself");

    if (translev == 0) {
        // just draw it over the top, no transparency
        abuf->Blit(surfaceToDraw, 0, 0, 0, 0, surfaceToDraw->GetWidth(), surfaceToDraw->GetHeight());
        target->FinishedDrawing();
        return;
    }

    if (surfaceToDraw->GetColorDepth() <= 8)
        quit("!DrawingSurface.DrawSurface: 256-colour surfaces cannot be drawn transparently");

    // Draw it transparently
    trans_mode = ((100-translev) * 25) / 10;
    put_sprite_256(0, 0, surfaceToDraw);
    target->FinishedDrawing();
}
开发者ID:bitope,项目名称:ags,代码行数:25,代码来源:drawingsurface.cpp

示例13: Create

    UINT CLkDuiButton::Create(
        const TCHAR* wnd_name,		// 窗口名称
        CLkDuiBase* pBefore,		// 上一级子窗口
        INT   x,
        INT   y,
        UINT uImageID,
        UINT nAvgelen)
    {
        UINT uRetID = 0;
        Bitmap* bmp = NULL;
        if (CLkDuiDC::ImageFromSource(bmp,NULL,uImageID,L"PNG"))
        {
            bef_size_.Width =bmp->GetWidth();
            bef_size_.Height = bmp->GetHeight();
            bef_Avgelen_ = nAvgelen;
            RECT rc = {x,y,x+bef_Avgelen_,y+bef_size_.Height};
            UINT uRetID = CLkDuiBase::Create(wnd_name,pBefore,rc);

            RECT rcBef = {0,0,bef_size_.Width,bef_size_.Height};
            dc_background_ = new CLkDuiDC(hWnd_,rc);
            dc_beforeground_ = new CLkDuiDC(hWnd_,rcBef);
            dc_background_->SetColor(bg_color_,TRUE);
            dc_beforeground_->SetImage(bmp,TRUE);
            delete bmp;

        }
        return uRetID;
    }
开发者ID:Linkai16,项目名称:Interface-Library,代码行数:28,代码来源:LkDuiButton.cpp

示例14: res

static RenderedBitmap *ThumbFromCoverPage(Doc doc, SizeI size)
{
    ImageData *coverImage = doc.GetCoverImage();
    if (!coverImage)
        return nullptr;
    Bitmap *coverBmp = BitmapFromData(coverImage->data, coverImage->len);
    if (!coverBmp)
        return nullptr;

    Bitmap res(size.dx, size.dy, PixelFormat24bppRGB);
    float scale = (float)size.dx / (float)coverBmp->GetWidth();
    int fromDy = size.dy;
    if (scale < 1.f)
        fromDy = (int)((float)coverBmp->GetHeight() * scale);
    Graphics g(&res);
    g.SetInterpolationMode(InterpolationModeHighQualityBicubic);
    Status ok = g.DrawImage(coverBmp, Rect(0, 0, size.dx, size.dy),
                            0, 0, coverBmp->GetWidth(), fromDy, UnitPixel);
    if (ok != Ok) {
        delete coverBmp;
        return nullptr;
    }
    HBITMAP hbmp;
    ok = res.GetHBITMAP((ARGB)Color::White, &hbmp);
    delete coverBmp;
    if (ok == Ok)
        return new RenderedBitmap(hbmp, SizeI(size.dx, size.dy));
    return nullptr;
}
开发者ID:jayceefun,项目名称:sumatrapdf,代码行数:29,代码来源:EbookController.cpp

示例15: RenderedBitmap

RenderedBitmap *LoadRenderedBitmap(const WCHAR *filePath)
{
    if (str::EndsWithI(filePath, L".bmp")) {
        HBITMAP hbmp = (HBITMAP)LoadImage(NULL, filePath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
        if (!hbmp)
            return NULL;
        return new RenderedBitmap(hbmp, GetBitmapSize(hbmp));
    }

    size_t len;
    ScopedMem<char> data(file::ReadAll(filePath, &len));
    if (!data)
        return NULL;
    Bitmap *bmp = BitmapFromData(data, len);
    if (!bmp)
        return NULL;

    HBITMAP hbmp;
    RenderedBitmap *rendered = NULL;
    if (bmp->GetHBITMAP(Color::White, &hbmp) == Ok)
        rendered = new RenderedBitmap(hbmp, SizeI(bmp->GetWidth(), bmp->GetHeight()));
    delete bmp;

    return rendered;
}
开发者ID:Livit,项目名称:moonpdf,代码行数:25,代码来源:ImagesEngine.cpp


注:本文中的Bitmap::GetHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。