AviMemDc: a C++ class
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了AviMemDc: a C++ class,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2934字,纯文字阅读大概需要5分钟。
内容图文
![AviMemDc: a C++ class](/upload/InfoBanner/zyjiaocheng/1311/71723a806bd64e8ab7651ad7b4fd52ea.jpg)
AviMemDc: a C++ class
This class is used in the Avi Examples.
The header file
AviMemDC.h
/*
AviMemDC.h
A C++ class for creating avi files
Copyright (c) 2004, 2005 René Nyffenegger
This source code is provided ‘as-is‘, without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/
#include "MemoryDC.h"
#include "DibSection.h"
#include "Color.h"
#include "Font.h"
#include "avi.h"
class AviMemDC : public MemoryDC {
public:
AviMemDC(int width, int height, std::string const& avi_file, int frames_per_second);
void AddFrame();
DibSection& GetDibSection();
private:
DibSection dib_section_;
Avi avi_;
bool compression_chosen_;
};
The implementation file
AviMemDC.cpp
/*
AviMemDC.cpp
A C++ class for creating avi files
Copyright (c) 2004, 2005 René Nyffenegger
This source code is provided ‘as-is‘, without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/
#include "AviMemDC.h"
AviMemDC::AviMemDC(int width, int height, std::string const& avi_file, int frames_per_second) :
MemoryDC(),
dib_section_(width, height),
avi_(avi_file, 1000/frames_per_second, 0),
compression_chosen_(false)
{
Select(dib_section_);
}
void AviMemDC::AddFrame() {
if (!compression_chosen_) {
avi_.compression(dib_section_, 0, true, 0);
compression_chosen_ = true;
}
avi_.add_frame(dib_section_);
}
DibSection& AviMemDC::GetDibSection() {
return dib_section_;
}
原文:http://www.cnblogs.com/honeynm/p/4695857.html
内容总结
以上是互联网集市为您收集整理的AviMemDc: a C++ class全部内容,希望文章能够帮你解决AviMemDc: a C++ class所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。