void CThirdoneDlg::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: 在此添加消息处理程序代码和/或调用默认值 CRect rect1(614,634,835,805); //yirengongsi CRect rect2(1046,631,1257,808); //heziyouxiangongsi CRect rect3(1453,460,1680,520);//tuishangye CRect rect4(1694,460,1893,520);//tuisouye CRect rect5(1135,171,1318,239);//sousuoanniu if (true == isPointInRect( point , rect1)){ CContentListDlg dlg; mynum=1; dlg.totaltypenum=mynum+fromwherenum; dlg.DoModal(); } if (true == isPointInRect( point , rect2)){ CContentListDlg dlg; mynum=2; dlg.totaltypenum=mynum+fromwherenum; dlg.DoModal(); } if (true == isPointInRect( point , rect3)){ CDialogEx::OnCancel(); } if (true == isPointInRect( point , rect4)){ CDialogEx::OnCancel(); } CDialogEx::OnLButtonDown(nFlags, point); }
//初始化函数 void CBitmapListCtrl::InitListCtrl(GetOrderName * pOrderFunction, UINT uComType) { CHappyGoDlg::InitListCtrl(pOrderFunction,uComType); //定义数据 m_uComType=uComType; lstrcpy(m_sztitle,TEXT("积分")); if (uComType==TY_MONEY_GAME) lstrcpy(m_sztitle,TEXT("金币")); else if (uComType==TY_MATCH_GAME) lstrcpy(m_sztitle,TEXT("积分")); this->SetBkColor(RGB(203, 211, 227)); CRect rect1(0,0,62,48);//头像 CRect rect2(62,6,192,26);//名字 CRect rect3(62,30,192,48);//等级 CRect rect4(192,6,283,26);//金币 CRect rect5(192,30,283,48);//金币数 CRect rect6(283,6,376,26);//赢 CRect rect7(283,30,376,48);//输 CRect rect8(376,6,408,48);//桌号 //CRect rect9(62,24,192,48); m_rlog=rect1; m_rname=rect2; m_rorder=rect3; m_rcoin=rect4; m_rcoinc=rect5; m_rwin=rect6; m_rloss=rect7; m_rdesk=rect8; //插入数据 SetRedraw(FALSE); //InsertColumn(0,"用户名",LVCFMT_LEFT,120); InsertColumn(0,"昵称",LVCFMT_LEFT,120); // InsertColumn(1,"ID 号码",LVCFMT_LEFT,60); /* InsertColumn(1,"桌号",LVCFMT_LEFT,40); InsertColumn(2,szBuffer,LVCFMT_LEFT,60); InsertColumn(3,"级别",LVCFMT_LEFT,90); InsertColumn(4,"总局数",LVCFMT_LEFT,50); InsertColumn(5,"胜局",LVCFMT_LEFT,50); InsertColumn(6,"输局",LVCFMT_LEFT,50); InsertColumn(7,"和局",LVCFMT_LEFT,50); InsertColumn(8,"逃跑",LVCFMT_LEFT,50);*/ // InsertColumn(12,"游戏社团",LVCFMT_CENTER,100); SetRedraw(TRUE); return; }
void ShockWaveRender::init(sf::RenderWindow * window) { _window = window; if (!_ShockWaveImg.loadFromFile(resourcePath() + "r-typesheet1.gif")) { std::cout << "ShockWave sprite not found" << std::endl; } sf::IntRect rect5(183, 170, 82, 15); _ShockWaveSpriteRect.push_back(rect5); _ShockWaveImg.setSmooth(true); _ShockWaveSprite.setTexture(_ShockWaveImg); _ShockWaveSprite.setTextureRect(_ShockWaveSpriteRect[0]); }
void SkinPainter::draw(int x, int y, int w, int h, QPainter &painter) { QRect rect1(0, 0, m_left, m_top); QRect rect2(m_left, 0, m_source.width() - m_left - m_right, m_top); QRect rect3(m_source.width() - m_right, 0, m_right, m_top); QRect rect4(0, m_top, m_left, m_source.height() - m_top - m_bottom); QRect rect5(m_left, m_top, m_source.width() - m_left - m_right, m_source.height() - m_top - m_bottom); QRect rect6(m_source.width() - m_right, m_top, m_right, m_source.height() - m_top - m_bottom); QRect rect7(0, m_source.height() - m_bottom, m_left, m_bottom); QRect rect8(m_left, m_source.height() - m_bottom, m_source.width() - m_left - m_right, m_bottom); QRect rect9(m_source.width() - m_right, m_source.height() - m_bottom, m_right, m_bottom); QPixmap p1 = m_source.copy(rect1); QPixmap p2 = m_source.copy(rect2); QPixmap p3 = m_source.copy(rect3); QPixmap p4 = m_source.copy(rect4); QPixmap p5 = m_source.copy(rect5); QPixmap p6 = m_source.copy(rect6); QPixmap p7 = m_source.copy(rect7); QPixmap p8 = m_source.copy(rect8); QPixmap p9 = m_source.copy(rect9); painter.drawPixmap(x, y, p1); qDebug("+x = %d, y = %d", x, y); //p2 = p2.scaledToWidth(w - p1.width() - p3.width()); for (int i = 0; i < w - p1.width() - p3.width(); i += p2.width()) { qDebug("x = %d, y = %d", x + p1.width() + i, y); painter.drawPixmap(x + p1.width() + i, y, p2); } qDebug("-x = %d, y = %d", x + w - p3.width(), y); painter.drawPixmap(x + w - p3.width(), y, p3); /* p4 = p4.scaledToHeight(h - p1.height() - p7.height()); painter.drawPixmap(x, y + p1.height(), p4); p5 = p5.scaledToWidth(w - p1.width() - p3.width()); p5 = p5.scaledToHeight(h - p1.height() - p7.height()); painter.drawPixmap(x + p4.width(), y + p1.height(), p5); p6 = p6.scaledToHeight(h - p1.height() - p7.height()); painter.drawPixmap(x + p4.width() + p5.width(), y + p3.height(), p6); painter.drawPixmap(x, y + p1.height() + p4.height(), p7); p8 = p8.scaledToWidth(w - p1.width() - p3.width()); p8 = p8.scaledToHeight(h - p1.height() - p7.height()); painter.drawPixmap(x + p7.width(), y + p2.height() + p5.height(), p8); painter.drawPixmap(x + p7.width() + p8.width(), y + p3.height() + p6.height(), p9); */ }
void object::test<5>() { // // test the LLRectf LLSD constructor // LLSD array; array.append(-1.0f); array.append(0.0f); array.append(0.0f); array.append(-1.0f); LLRectf rect5(array); ensure_equals("LLSD rectf left", rect5.mLeft, -1.0f); ensure_equals("LLSD rectf top", rect5.mTop, 0.0f); ensure_equals("LLSD rectf right", rect5.mRight, 0.0f); ensure_equals("LLSD rectf bottom", rect5.mBottom, -1.0f); ensure_equals("LLSD rectf width", rect5.getWidth(), 1.0f); ensure_equals("LLSD rectf height", rect5.getHeight(), 1.0f); ensure_equals("LLSD rectf centerx", rect5.getCenterX(), -0.5f); ensure_equals("LLSD rectf centery", rect5.getCenterY(), -0.5f); }
FlattenTestImage() : refRect(0,0,512,512) , p(refRect) { image = p.image; layer1 = p.layer; layer5 = new KisPaintLayer(p.image, "paint5", 0.4 * OPACITY_OPAQUE_U8); layer5->disableAlphaChannel(true); layer2 = new KisPaintLayer(p.image, "paint2", OPACITY_OPAQUE_U8); tmask = new KisTransparencyMask(); // check channel flags // make addition composite op group1 = new KisGroupLayer(p.image, "group1", OPACITY_OPAQUE_U8); layer3 = new KisPaintLayer(p.image, "paint3", OPACITY_OPAQUE_U8); layer4 = new KisPaintLayer(p.image, "paint4", OPACITY_OPAQUE_U8); layer6 = new KisPaintLayer(p.image, "paint6", OPACITY_OPAQUE_U8); layer7 = new KisPaintLayer(p.image, "paint7", OPACITY_OPAQUE_U8); layer8 = new KisPaintLayer(p.image, "paint8", OPACITY_OPAQUE_U8); layer7->setCompositeOp(COMPOSITE_ADD); layer8->setCompositeOp(COMPOSITE_ADD); QRect rect1(100, 100, 100, 100); QRect rect2(150, 150, 150, 150); QRect tmaskRect(200,200,100,100); QRect rect3(400, 100, 100, 100); QRect rect4(500, 100, 100, 100); QRect rect5(50, 50, 100, 100); QRect rect6(50, 250, 100, 100); QRect rect7(50, 350, 50, 50); QRect rect8(50, 400, 50, 50); layer1->paintDevice()->fill(rect1, KoColor(Qt::red, p.image->colorSpace())); layer2->paintDevice()->fill(rect2, KoColor(Qt::green, p.image->colorSpace())); tmask->testingInitSelection(tmaskRect); layer3->paintDevice()->fill(rect3, KoColor(Qt::blue, p.image->colorSpace())); layer4->paintDevice()->fill(rect4, KoColor(Qt::yellow, p.image->colorSpace())); layer5->paintDevice()->fill(rect5, KoColor(Qt::green, p.image->colorSpace())); layer6->paintDevice()->fill(rect6, KoColor(Qt::cyan, p.image->colorSpace())); layer7->paintDevice()->fill(rect7, KoColor(Qt::red, p.image->colorSpace())); layer8->paintDevice()->fill(rect8, KoColor(Qt::green, p.image->colorSpace())); KisPSDLayerStyleSP style(new KisPSDLayerStyle()); style->dropShadow()->setEffectEnabled(true); style->dropShadow()->setDistance(10.0); style->dropShadow()->setSpread(80.0); style->dropShadow()->setSize(10); style->dropShadow()->setNoise(0); style->dropShadow()->setKnocksOut(false); style->dropShadow()->setOpacity(80.0); layer2->setLayerStyle(style); layer2->setCompositeOp(COMPOSITE_ADD); group1->setCompositeOp(COMPOSITE_ADD); p.image->addNode(layer5); p.image->addNode(layer2); p.image->addNode(tmask, layer2); p.image->addNode(group1); p.image->addNode(layer3, group1); p.image->addNode(layer4, group1); p.image->addNode(layer6); p.image->addNode(layer7); p.image->addNode(layer8); p.image->initialRefreshGraph(); // dbgKrita << ppVar(layer1->exactBounds()); // dbgKrita << ppVar(layer5->exactBounds()); // dbgKrita << ppVar(layer2->exactBounds()); // dbgKrita << ppVar(group1->exactBounds()); // dbgKrita << ppVar(layer3->exactBounds()); // dbgKrita << ppVar(layer4->exactBounds()); TestUtil::ExternalImageChecker chk("flatten", "imagetest"); QVERIFY(chk.checkDevice(p.image->projection(), p.image, "00_initial")); }
static void test_CRect() { CRect empty; ok(empty.left == 0, "Expected left to be 0, was %ld\n", empty.left); ok(empty.top == 0, "Expected top to be 0, was %ld\n", empty.top); ok(empty.Width() == 0, "Expected Width to be 0, was %i\n", empty.Width()); ok(empty.Height() == 0, "Expected Height to be 0, was %i\n", empty.Height()); CRect rect(0, 0, 100, 50); ok(rect.Width() == 100, "Expected Width to be 100, was %i\n", rect.Width()); ok(rect.Height() == 50, "Expected Height to be 50, was %i\n", rect.Height()); RECT sdkRect; sdkRect.left = 0; sdkRect.top = 0; sdkRect.right = 100; sdkRect.bottom = 50; CRect rect2(sdkRect); CRect rect3(&sdkRect); ok_rect(rect2, rect); ok_rect(rect3, rect); CPoint pt(0, 0); CSize sz(100, 50); CRect rect4(pt, sz); ok_rect(rect4, rect2); CPoint ptBottomRight(100, 50); CRect rect5(pt, ptBottomRight); ok_rect(rect5, rect4); rect = CRect(210, 150, 350, 900); CPoint ptDown; ptDown = rect.BottomRight(); pt = CPoint(350, 900); ok_point(ptDown, pt); rect2 = CRect(10, 10, 350, 350); CPoint ptLow(180, 180); rect2.BottomRight() = ptLow; rect = CRect(10, 10, 180, 180); ok_rect(rect2, rect); pt = CPoint(95, 95); CPoint pt2 = rect2.CenterPoint(); ok_point(pt2, pt); pt2 = rect2.BottomRight(); pt = CPoint(180, 180); ok_point(pt2, pt); pt2 = rect2.TopLeft(); pt = CPoint(10, 10); ok_point(pt2, pt); rect2.TopLeft().Offset(3, 3); rect3 = CRect(13, 13, 180, 180); ok_rect(rect3, rect2); CRect rectSource(35, 10, 125, 10); CRect rectDest; rectDest.CopyRect(&rectSource); RECT rectSource2; rectSource2.left = 0; rectSource2.top = 0; rectSource2.bottom = 480; rectSource2.right = 640; rectDest.CopyRect(&rectSource2); rect = CRect(10, 10, 50, 50); rect.DeflateRect(1, 2); rect2 = CRect(11, 12, 49, 48); ok_rect(rect2, rect); rect2 = CRect(10, 10, 50, 50); CRect rectDeflate(1, 2, 3, 4); rect2.DeflateRect(&rectDeflate); rect = CRect(11, 12, 47, 46); ok_rect(rect2, rect); rect2.DeflateRect(sz); rect = CRect(111, 62, -53, -4); ok_rect(rect2, rect); rect2.OffsetRect(sz); rect = CRect(211, 112, 47, 46); ok_rect(rect2, rect); CRect rect1(35, 150, 10, 25); rect2 = CRect(35, 150, 10, 25); rect3 = CRect(98, 999, 6, 3); ok(rect1.EqualRect(rect2), "Expected EqualRect to return TRUE for %s, %s\n", wine_dbgstr_rect(&rect1), wine_dbgstr_rect(&rect2)); ok(!rect1.EqualRect(rect3), "Expected EqualRect to return FALSE for %s, %s\n", wine_dbgstr_rect(&rect1), wine_dbgstr_rect(&rect3)); RECT test; test.left = 35; test.top = 150; test.right = 10; test.bottom = 25; ok(rect1.EqualRect(&test), "Expected EqualRect to return TRUE for %s, %s\n", wine_dbgstr_rect(&rect1), wine_dbgstr_rect(&test)); rect = test; rect2 = CRect(35, 150, 10, 25); ok_rect(rect, rect2); rect = CRect(0, 0, 300, 300); rect.InflateRect(50, 200); rect2 = CRect(-50, -200, 350, 500); ok_rect(rect, rect2); rect.InflateRect(sz); rect2 = CRect(-150, -250, 450, 550); ok_rect(rect, rect2); rect = CRect(20, 30, 80, 70); int nHt = rect.Height(); ok(nHt == 40, "Expected nHt to be 40, was %i\n", nHt); CRect rectOne(125, 0, 150, 200); CRect rectTwo(0, 75, 350, 95); CRect rectInter; rectInter.IntersectRect(rectOne, rectTwo); rect = CRect(125, 75, 150, 95); ok_rect(rectInter, rect); CRect rectInter2 = rectOne; rectInter2 &= rectTwo; rect = CRect(125, 75, 150, 95); ok_rect(rectInter2, rect); CRect rectNone(0, 0, 0, 0); CRect rectSome(35, 50, 135, 150); ok(rectNone.IsRectEmpty(), "Expected IsRectEmpty to return TRUE for %s\n", wine_dbgstr_rect(&rectNone)); ok(!rectSome.IsRectEmpty(), "Expected IsRectEmpty to return FALSE for %s\n", wine_dbgstr_rect(&rectSome)); CRect rectEmpty(35, 35, 35, 35); ok(rectEmpty.IsRectEmpty(), "Expected IsRectEmpty to return TRUE for %s\n", wine_dbgstr_rect(&rectEmpty)); ok(rectNone.IsRectNull(), "Expected IsRectNull to return TRUE for %s\n", wine_dbgstr_rect(&rectNone)); ok(!rectSome.IsRectNull(), "Expected IsRectNull to return FALSE for %s\n", wine_dbgstr_rect(&rectSome)); CRect rectNotNull(0, 0, 35, 50); ok(!rectNotNull.IsRectNull(), "Expected IsRectNull to return FALSE for %s\n", wine_dbgstr_rect(&rectNotNull)); rect1 = CRect(35, 150, 10, 25); rect2 = CRect(35, 150, 10, 25); rect3 = CRect(98, 999, 6, 3); ok_rect(rect1, rect2); test.left = 35; test.top = 150; test.right = 10; test.bottom = 25; ok_rect(rect1, test); nok_rect(rect1, rect3); nok_rect(rect3, test); rect1 = CRect(100, 235, 200, 335); pt = CPoint(35, 65); rect2 = CRect(135, 300, 235, 400); rect1 += pt; ok_rect(rect1, rect2); rect1 = CRect(100, 235, 200, 335); rect2 = rect1 + pt; CRect rectResult(135, 300, 235, 400); ok_rect(rectResult, rect2); rect2 = rect1 + &test; rectResult = CRect(65, 85, 210, 360); ok_rect(rectResult, rect2); rect2 = rect1 - (LPCRECT)&test; rectResult = CRect(135, 385, 190, 310); ok_rect(rectResult, rect2); rect2 = rect1 - pt; rectResult = CRect(65, 170, 165, 270); ok_rect(rect2, rectResult); rect1 -= pt; ok_rect(rect1, rectResult); rect1 = CRect(100, 0, 200, 300); rect2 = CRect(0, 100, 300, 200); rect3 = rect1 & rect2; rectResult = CRect(100, 100, 200, 200); ok_rect(rectResult, rect3); rect3 = rect1 | rect2; rectResult = CRect(0, 0, 300, 300); ok_rect(rectResult, rect3); rect1 |= rect2; ok_rect(rectResult, rect1); rect1 += sz; rectResult = CRect(100, 50, 400, 350); ok_rect(rectResult, rect1); rect1 += &test; rectResult = CRect(65, -100, 410, 375); ok_rect(rectResult, rect1); rect1 -= sz; rectResult = CRect(-35, -150, 310, 325); ok_rect(rectResult, rect1); rect1 -= &test; rectResult = CRect(0, 0, 300, 300); ok_rect(rectResult, rect1); rect2 = rect1 + sz; rectResult = CRect(100, 50, 400, 350); ok_rect(rectResult, rect2); rect2 = rect1 - sz; rectResult = CRect(-100, -50, 200, 250); ok_rect(rectResult, rect2); }