本文整理汇总了C++中CSurface::GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ CSurface::GetHeight方法的具体用法?C++ CSurface::GetHeight怎么用?C++ CSurface::GetHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSurface
的用法示例。
在下文中一共展示了CSurface::GetHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void CStatBox::Draw(CSurface* display,int x,int y)
{
CSurface* line;
int drawy = y;
for(int i = 0; i<lines->size(); i++)
{
line = lines->at(i);
if(line != NULL)
{
line->Draw(display,x,drawy);
drawy += line->GetHeight() + STATBOX_LINE_PADDING;
}
}
}
示例2: CalcHeight
int CStatBox::CalcHeight()
{
//find sum of line heights, plus padding
int height = 0;
CSurface* line;
for(int i = 0; i<lines->size(); i++)
{
line = lines->at(i);
if(line != NULL)
{
height += line->GetHeight();
}
}
height += (lines->size() - 1) * STATBOX_LINE_PADDING;
return height;
}
示例3: Write
bool CTgaWriter::Write(const std::string& fileName, CSurface& surface)
{
m_FileName=fileName;
//file = IGenericFile::Open(fileName.c_str(), IGenericFile::OPEN_READ | IGenericFile::OPEN_BINARY | IGenericFile::OPEN_STANDALONE, false, true);
m_File.open(fileName.c_str(),std::ios::out|std::ios::binary);
if(!m_File)return false;
memset(&m_Header,0,sizeof(m_Header));
m_Header.Width=surface.GetWidth();
m_Header.Height=surface.GetHeight();
m_Header.Bits=surface.GetDepth()<<3;
if(surface.GetFormat()==CSurface::EFormat_A8R8G8B8 || surface.GetFormat()==CSurface::EFormat_R8G8B8 || surface.GetFormat()==CSurface::EFormat_X8R8G8B8){
m_Header.ImageType=2;
}else if(surface.GetFormat()==CSurface::EFormat_S8){
m_Header.ImageType=3;
}
// Write header
m_Header.Write(m_File);
if(!m_File)return false;
// Write data
m_File.write((char*)surface.GetDataPointer(),surface.GetSize());
// Close and bail out
if(!m_File)return false;
m_File.close();
return true;
}