这篇教程C++ GetHeight函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetHeight函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHeight函数的具体用法?C++ GetHeight怎么用?C++ GetHeight使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetHeight函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Clear void Clear() { Rectangle(0, 0, GetWidth(), GetHeight()); }
开发者ID:MaxPower-No1,项目名称:XCSoar,代码行数:3,
示例2: GetFormat uint32 DiTexture::GetHeightInBlocks(void) const { return DiPixelBox::GetFormatNumBlocks(GetHeight(), GetFormat()); }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:4,
示例3: Vector2Vector2 ScenePanel::ConvertToPanelSpace(const Point2D& point) const{ return Vector2(point.X, GetHeight() - point.Y);}
开发者ID:colajam93,项目名称:pomdog,代码行数:4,
示例4: Resetvoid VideoContext::SetVideo(const wxString &filename) { Reset(); if (filename.empty()) { VideoOpen(); return; } bool commit_subs = false; try { provider.reset(new ThreadedFrameSource(filename, this)); videoProvider = provider->GetVideoProvider(); videoFile = filename; // Check that the script resolution matches the video resolution int sx = context->ass->GetScriptInfoAsInt("PlayResX"); int sy = context->ass->GetScriptInfoAsInt("PlayResY"); int vx = GetWidth(); int vy = GetHeight(); // If the script resolution hasn't been set at all just force it to the // video resolution if (sx == 0 && sy == 0) { context->ass->SetScriptInfo("PlayResX", wxString::Format("%d", vx)); context->ass->SetScriptInfo("PlayResY", wxString::Format("%d", vy)); commit_subs = true; } // If it has been set to something other than a multiple of the video // resolution, ask the user if they want it to be fixed else if (sx % vx != 0 || sy % vy != 0) { switch (OPT_GET("Video/Check Script Res")->GetInt()) { case 1: // Ask to change on mismatch if (wxYES != wxMessageBox( wxString::Format(_("The resolution of the loaded video and the resolution specified for the subtitles don't match./n/nVideo resolution:/t%d x %d/nScript resolution:/t%d x %d/n/nChange subtitles resolution to match video?"), vx, vy, sx, sy), _("Resolution mismatch"), wxYES_NO | wxCENTER, context->parent)) break; // Fallthrough to case 2 case 2: // Always change script res context->ass->SetScriptInfo("PlayResX", wxString::Format("%d", vx)); context->ass->SetScriptInfo("PlayResY", wxString::Format("%d", vy)); commit_subs = true; break; default: // Never change break; } } keyFrames = videoProvider->GetKeyFrames(); // Set frame rate videoFPS = videoProvider->GetFPS(); if (ovrFPS.IsLoaded()) { int ovr = wxMessageBox(_("You already have timecodes loaded. Would you like to replace them with timecodes from the video file?"), _("Replace timecodes?"), wxYES_NO | wxICON_QUESTION); if (ovr == wxYES) { ovrFPS = agi::vfr::Framerate(); ovrTimecodeFile.clear(); } } // Set aspect ratio double dar = videoProvider->GetDAR(); if (dar > 0) SetAspectRatio(4, dar); // Set filename config::mru->Add("Video", STD_STR(filename)); StandardPaths::SetPathValue("?video", wxFileName(filename).GetPath()); // Show warning wxString warning = videoProvider->GetWarning(); if (!warning.empty()) wxMessageBox(warning, "Warning", wxICON_WARNING | wxOK); hasSubtitles = false; if (filename.Right(4).Lower() == ".mkv") { hasSubtitles = MatroskaWrapper::HasSubtitles(filename); } provider->LoadSubtitles(context->ass); VideoOpen(); KeyframesOpen(keyFrames); TimecodesOpen(FPS()); } catch (agi::UserCancelException const&) { } catch (agi::FileNotAccessibleError const& err) { config::mru->Remove("Video", STD_STR(filename)); wxMessageBox(lagi_wxString(err.GetMessage()), "Error setting video", wxOK | wxICON_ERROR | wxCENTER); } catch (VideoProviderError const& err) { wxMessageBox(lagi_wxString(err.GetMessage()), "Error setting video", wxOK | wxICON_ERROR | wxCENTER); } if (commit_subs) context->ass->Commit(_("change script resolution"), AssFile::COMMIT_SCRIPTINFO); else JumpToFrame(0);}
开发者ID:Azpidatziak,项目名称:Aegisub,代码行数:98,
示例5: plogpalvoid PLWEMFDecoder::GetImage (PLBmpBase & Bmp){ HPALETTE hpal = NULL; LPLOGPALETTE plogpal (0); if (GetBitsPerPixel() == 8) { plogpal = (LPLOGPALETTE)new PLBYTE[sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * 256)]; memset(plogpal,0x0,sizeof(LOGPALETTE) + sizeof(PALETTEENTRY)*256); plogpal->palVersion = 0x300; plogpal->palNumEntries = 256; if (plogpal == NULL) { PLASSERT(false); raiseError (PL_ERRNO_MEMORY,"Cannot allocate palette."); } UINT pe = GetEnhMetaFilePaletteEntries(m_hemf, 0, NULL); GetEnhMetaFilePaletteEntries(m_hemf, pe, plogpal->palPalEntry); } // Setup a logical palette for our memory dc and also a // paintlib compatible palette for the paintlib bitmap PLPixel32 pPal[256]; if (plogpal) { for (UINT i = 0; i < 256; i++) { pPal[i] = *(PLPixel32*)&plogpal->palPalEntry[i]; } if ( 0 != (hpal = CreatePalette((LPLOGPALETTE)plogpal)) ) { m_holdpal = SelectPalette(m_memdc, hpal, false); RealizePalette(m_memdc); } Bmp.SetPalette(pPal); delete [] plogpal; } // Play the metafile into the device context // First, setup a bounding rectangle and fill // the memory dc with white (some metafiles only // use a black pen to draw and have no actual fill // color set, This would cause a black on black // painting which is rather useless RECT rc; rc.left = rc.top = 0; rc.bottom = GetHeight(); rc.right = GetWidth(); FillRect(m_memdc,&rc,(HBRUSH)GetStockObject(WHITE_BRUSH)); // Heeere we go.... /*BOOL bres =*/ PlayEnhMetaFile(m_memdc,m_hemf,&rc); // Finally, convert the Windows bitmap into a paintlib bitmap PLWinBmp& winbmp = dynamic_cast<PLWinBmp&>(Bmp); BITMAPINFO* pBMI = (BITMAPINFO*)winbmp.GetBMI(); //PLBYTE* pBits = (PLBYTE*)winbmp.GetBits(); if (GetBitsPerPixel() == 8) { GetDIBits(m_dc, m_bm, 0, GetHeight(), winbmp.GetBits(), pBMI, DIB_RGB_COLORS); } else { GetDIBits(m_dc, m_bm, 0, GetHeight(), winbmp.GetBits(), pBMI, DIB_PAL_COLORS); }}
开发者ID:artcom,项目名称:y60,代码行数:61,
示例6: rpwxRealPoint ExplainShape::GetStartPoint(){ wxRealPoint rp(GetX() + GetBitmap().GetWidth() / 2.0 + ARROWMARGIN, GetY() - (GetHeight() - GetBitmap().GetHeight()) / 2.); return rp;}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:5,
示例7: GetHeightvoid CPowerupRapidFire::Render(void){ CSGD_TextureManager *pTM = CSGD_TextureManager::GetInstance(); pTM->Draw(GetImageID(),GetCollisionRect().left,GetCollisionRect().top,1.5f,1.5f,&rPowerupRect,GetWidth() / 2, GetHeight() /2,0,D3DCOLOR_XRGB(255,255,255));}
开发者ID:jakneute,项目名称:Earthworm-Jim-Full-Sail-Game-Project,代码行数:5,
示例8: sfRenderTexture_GetHeightunsigned int sfRenderTexture_GetHeight(const sfRenderTexture* renderTexture){ CSFML_CALL_RETURN(renderTexture, GetHeight(), 0);}
开发者ID:deadalnix,项目名称:CSFML,代码行数:4,
示例9: YamlNodebool HierarchyTreePlatformNode::Save(YamlNode* node, bool saveAll){ YamlNode* platform = new YamlNode(YamlNode::TYPE_MAP); platform->Set(WIDTH_NODE, GetWidth()); platform->Set(HEIGHT_NODE, GetHeight()); MultiMap<String, YamlNode*> &platformsMap = node->AsMap(); platformsMap.erase(GetName().toStdString()); platformsMap.insert(std::pair<String, YamlNode*>(GetName().toStdString(), platform)); ActivatePlatform(); MultiMap<String, YamlNode*> &platformMap = platform->AsMap(); YamlNode* screens = new YamlNode(YamlNode::TYPE_ARRAY); platformMap.erase(SCREENS_NODE); platformMap.insert(std::pair<String, YamlNode*>(SCREENS_NODE, screens)); YamlNode* aggregators = new YamlNode(YamlNode::TYPE_MAP); platformMap.erase(AGGREGATORS_NODE); platformMap.insert(std::pair<String, YamlNode*>(AGGREGATORS_NODE, aggregators)); // Add the Localization info - specific for each Platform. SaveLocalization(platform); QString platformFolder = GetPlatformFolder(); QDir dir; dir.mkpath(platformFolder); bool result = true; //save aggregators node before save screens for (HIERARCHYTREENODESCONSTITER iter = GetChildNodes().begin(); iter != GetChildNodes().end(); ++iter) { HierarchyTreeAggregatorNode* node = dynamic_cast<HierarchyTreeAggregatorNode*>(*iter); if (!node) continue; QString path = QString(SCREEN_PATH).arg(platformFolder).arg(node->GetName()); MultiMap<String, YamlNode*> &aggregatorsMap = aggregators->AsMap(); YamlNode* aggregator = new YamlNode(YamlNode::TYPE_MAP); result &= node->Save(aggregator, path, saveAll); aggregatorsMap.erase(node->GetName().toStdString()); aggregatorsMap.insert(std::pair<String, YamlNode*>(node->GetName().toStdString(), aggregator)); } for (HIERARCHYTREENODESCONSTITER iter = GetChildNodes().begin(); iter != GetChildNodes().end(); ++iter) { HierarchyTreeAggregatorNode* node = dynamic_cast<HierarchyTreeAggregatorNode*>(*iter); if (node) continue; //skip aggregators HierarchyTreeScreenNode* screenNode = dynamic_cast<HierarchyTreeScreenNode*>(*iter); if (!screenNode) continue; QString screenPath = QString(SCREEN_PATH).arg(platformFolder).arg(screenNode->GetName()); result &= screenNode->Save(screenPath, saveAll); screens->AddValueToArray(screenNode->GetName().toStdString()); } return result;}
开发者ID:vilonosec,项目名称:dava.framework,代码行数:69,
示例10: SetPos// ----------------------------------------------------------------------------// Name : ResetPosition()// Desc :// ----------------------------------------------------------------------------void CUISelectResource::ResetPosition( PIX pixMinI, PIX pixMinJ, PIX pixMaxI, PIX pixMaxJ ){ SetPos( ( pixMaxI + pixMinI - GetWidth() ) / 2, ( pixMaxJ + pixMinJ - GetHeight() ) / 2 );}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:8,
示例11: GetHeight// ----------------------------------------------------------------------------// Name : AdjustPosition()// Desc :// ----------------------------------------------------------------------------void CUISelectResource::AdjustPosition( PIX pixMinI, PIX pixMinJ, PIX pixMaxI, PIX pixMaxJ ){ if( m_nPosX < pixMinI || m_nPosX + GetWidth() > pixMaxI || m_nPosY < pixMinJ || m_nPosY + GetHeight() > pixMaxJ ) ResetPosition( pixMinI, pixMinJ, pixMaxI, pixMaxJ );}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:10,
示例12: TextAutoClipped /** * Render text, clip it within the bounds of this Canvas. */ void TextAutoClipped(int x, int y, const TCHAR *t) { if (x < (int)GetWidth() && y < (int)GetHeight()) DrawClippedText(x, y, GetWidth() - x, GetHeight() - y, t); }
开发者ID:MaxPower-No1,项目名称:XCSoar,代码行数:7,
示例13: wxSizewxSize wxStatusBarUniv::DoGetBestSize() const{ return wxSize(100, GetHeight());}
开发者ID:EdgarTx,项目名称:wx,代码行数:4,
示例14: Decodebool CxImage::Load(const char * filename, DWORD imagetype)#endif//bool CxImage::Load(const char * filename, DWORD imagetype){ /*FILE* hFile; //file handle to read the image if ((hFile=fopen(filename,"rb"))==NULL) return false; bool bOK = Decode(hFile,imagetype); fclose(hFile);*/#ifdef XBMC int iWidthSave = iWidth; int iHeightSave = iHeight;#endif /* automatic file type recognition */ bool bOK = false; if ( GetTypeIndexFromId(imagetype) ){ FILE* hFile; //file handle to read the image#ifdef WIN32 if ((hFile=_tfopen(filename,_T("rb")))==NULL) return false; // For UNICODE support#else if ((hFile=fopen(filename,"rb"))==NULL) return false;#endif#ifdef XBMC bOK = Decode(hFile,imagetype,iWidth,iHeight); if (imagetype != CXIMAGE_FORMAT_JPG) { iWidth = GetWidth(); iHeight = GetHeight(); }#else bOK = Decode(hFile,imagetype);#endif fclose(hFile); if (bOK) return bOK; } char szError[256]; strcpy(szError,info.szLastError); //save the first error // if failed, try automatic recognition of the file... FILE* hFile;#ifdef WIN32 if ((hFile=_tfopen(filename,_T("rb")))==NULL) return false; // For UNICODE support#else if ((hFile=fopen(filename,"rb"))==NULL) return false;#endif#ifdef XBMC bOK = Decode(hFile,CXIMAGE_FORMAT_UNKNOWN,iWidth,iHeight); if (imagetype != CXIMAGE_FORMAT_JPG) { iWidth = GetWidth(); iHeight = GetHeight(); }#else bOK = Decode(hFile,CXIMAGE_FORMAT_UNKNOWN);#endif fclose(hFile); if (!bOK && imagetype > 0) strcpy(info.szLastError,szError); //restore the first error return bOK;}
开发者ID:0MasteR0,项目名称:xbmc,代码行数:68,
示例15: WXUNUSEDvoid wxStatusBarUniv::DoSetSize(int x, int y, int width, int WXUNUSED(height), int sizeFlags){ wxStatusBarBase::DoSetSize(x, y, width, GetHeight(), sizeFlags);}
开发者ID:EdgarTx,项目名称:wx,代码行数:6,
示例16: GetHeight////////////////////////////////////////////////////////////////////////////////// // FUNCTION: GetSize// // DESCRIPTION: Returns Width and Height object// // RETURNS: // // NOTES: // // MODIFICATIONS:// // Name Date Version Comments// N T ALMOND 29012002 1.0 Origin// ////////////////////////////////////////////////////////////////////////////////SIZE ImageEx::GetSize(){ SIZE size={GetWidth(), GetHeight()}; return size;}
开发者ID:BraveStone,项目名称:xcgui,代码行数:21,
示例17: UIWindowDialog::Dialog(UIWindow *parent, float width, float height, bool modal) : UIWindow(/*modal ? new Substrate(parent) :*/ parent) , _mouseX(0) , _mouseY(0) , _easyMove(false){ SetTexture("ui/window", false); Resize(width, height); Move(std::floor((parent->GetWidth() - GetWidth()) / 2), std::floor((parent->GetHeight() - GetHeight()) / 2)); SetDrawBorder(true); SetDrawBackground(true); GetManager().SetFocusWnd(this);}
开发者ID:olitvinenko,项目名称:battle_tanks,代码行数:13,
示例18: OrderedDitherBitmapstatic void OrderedDitherBitmap(CSBitmap* pBitmap, int ditherAmount){ const int DITHERSIZE = 16; // A sixteen by sixteen dither table holds 256 values, // which is enough to give us dither values from zero to 255. int DitherArray[DITHERSIZE][DITHERSIZE] = { { 0, 128, 32, 160, 8, 136, 40, 168, 2, 130, 34, 162, 10, 138, 42, 170, }, {192, 64, 224, 96, 200, 72, 232, 104, 194, 66, 226, 98, 202, 74, 234, 106, }, {48, 176, 16, 144, 56, 184, 24, 152, 50, 178, 18, 146, 58, 186, 26, 154, }, {240, 112, 208, 80, 248, 120, 216, 88, 242, 114, 210, 82, 250, 122, 218, 90, }, {12, 140, 44, 172, 4, 132, 36, 164, 14, 142, 46, 174, 6, 134, 38, 166, }, {204, 76, 236, 108, 196, 68, 228, 100, 206, 78, 238, 110, 198, 70, 230, 102, }, {60, 188, 28, 156, 52, 180, 20, 148, 62, 190, 30, 158, 54, 182, 22, 150, }, {252, 124, 220, 92, 244, 116, 212, 84, 254, 126, 222, 94, 246, 118, 214, 86, }, { 3, 131, 35, 163, 11, 139, 43, 171, 1, 129, 33, 161, 9, 137, 41, 169, }, {195, 67, 227, 99, 203, 75, 235, 107, 193, 65, 225, 97, 201, 73, 233, 105, }, {51, 179, 19, 147, 59, 187, 27, 155, 49, 177, 17, 145, 57, 185, 25, 153, }, {243, 115, 211, 83, 251, 123, 219, 91, 241, 113, 209, 81, 249, 121, 217, 89, }, {15, 143, 47, 175, 7, 135, 39, 167, 13, 141, 45, 173, 5, 133, 37, 165, }, {207, 79, 239, 111, 199, 71, 231, 103, 205, 77, 237, 109, 197, 69, 229, 101, }, {63, 191, 31, 159, 55, 183, 23, 151, 61, 189, 29, 157, 53, 181, 21, 149, }, {255, 127, 223, 95, 247, 119, 215, 87, 253, 125, 221, 93, 245, 117, 213, 85, }, }; assert(GetChannels(pBitmap) >= 3); assert(ditherAmount > 0); if (ditherAmount == 1) return; // There's nothing to do. // ditherAmount is the number of distinct values we want to be adding // to our bitmap. We want these values to range between zero and // ditherAmount - 1, so we subtract one here. ditherAmount -= 1; int NumChannels = GetChannels(pBitmap); // Before we do the dithering we have to get the values into the right // range. We then have to subtract off ditherAmount / 2 which is half of // the maximum value so that the values are centered about zero. for (int y = 0; y < DITHERSIZE; y++) { for (int x = 0; x < DITHERSIZE; x++) { int Temp = (DitherArray[y][x] * ditherAmount + 127) / 255; assert(Temp >= 0 && Temp <= ditherAmount); DitherArray[y][x] = Temp - ditherAmount / 2; } } // Now we can dither our image. for (int y = 0; y < GetHeight(pBitmap); y++) { unsigned char* pLine = GetLinePtr(pBitmap, y); int* pDitherLine = DitherArray[y & (DITHERSIZE - 1)]; for (int x = 0; x < GetWidth(pBitmap); x++) { int DitherAmount = pDitherLine[x & (DITHERSIZE - 1)]; for (int channels = 0; channels < NumChannels; channels++) { int DitheredPixel = (int)pLine[channels] + DitherAmount; if (DitheredPixel < 0) DitheredPixel = 0; if (DitheredPixel > 255) DitheredPixel = 255; pLine[channels] = DitheredPixel; } pLine += NumChannels; } }}
开发者ID:ddionisio,项目名称:pinball,代码行数:68,
示例19: GetViewportExtent/** * Draws the emulated screens to the emulator window. */void RendererOpenGL::DrawScreens() { auto viewport_extent = GetViewportExtent(); glViewport(viewport_extent.left, viewport_extent.top, viewport_extent.GetWidth(), viewport_extent.GetHeight()); // TODO: Or bottom? glClear(GL_COLOR_BUFFER_BIT); glUseProgram(program_id); // Set projection matrix std::array<GLfloat, 3*2> ortho_matrix = MakeOrthographicMatrix((float)resolution_width, (float)resolution_height); glUniformMatrix3x2fv(uniform_modelview_matrix, 1, GL_FALSE, ortho_matrix.data()); // Bind texture in Texture Unit 0 glActiveTexture(GL_TEXTURE0); glUniform1i(uniform_color_texture, 0); const float max_width = std::max((float)VideoCore::kScreenTopWidth, (float)VideoCore::kScreenBottomWidth); const float top_x = 0.5f * (max_width - VideoCore::kScreenTopWidth); const float bottom_x = 0.5f * (max_width - VideoCore::kScreenBottomWidth); DrawSingleScreenRotated(textures[0], top_x, 0, (float)VideoCore::kScreenTopWidth, (float)VideoCore::kScreenTopHeight); DrawSingleScreenRotated(textures[1], bottom_x, (float)VideoCore::kScreenTopHeight, (float)VideoCore::kScreenBottomWidth, (float)VideoCore::kScreenBottomHeight); m_current_frame++;}
开发者ID:Sovichea,项目名称:citra,代码行数:29,
示例20: GetStockObjectvoid CBackBuffer::Clear(){ HBRUSH hOldBrush = static_cast<HBRUSH>(SelectObject(GetBFDC(), GetStockObject(WHITE_BRUSH))); Rectangle(GetBFDC(), 0, 0, GetWidth(), GetHeight()); SelectObject(GetBFDC(), hOldBrush);}
开发者ID:Moorecj007,项目名称:GD2P04---Advanced-Graphics,代码行数:6,
示例21: FindChildInPanevoid CChatRoomDlg::AddChatMsg_ZList( const char* pszMsg, DWORD dwColor ){ CWinCtrl* pCtrl = FindChildInPane( IID_PANE_BOTTOM, IID_CHAT_LIST ); if( pCtrl && pCtrl->GetControlType() == CTRL_ZLISTBOX) { CZListBox* pListBox = (CZListBox*)pCtrl; int iItemCount = pListBox->GetSize(); int iWidth = pListBox->GetWidth(); //06.07.27 - C++ GetHitDamage函数代码示例 C++ GetHealthPercent函数代码示例
|