Avimemdc:a C + + class

Source: Internet
Author: User

Avimemdc:a C + + class

This was 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 was provided ' As-is ', without any express or implied
Warranty. In no event would the author be held liable for any damages
arising from the 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 being misrepresented; You must not
Claim that wrote the original source code. If You use the This source code
In a product, an acknowledgment in the product documentation would is
appreciated but isn't required.

2. Altered source versions must is plainly marked as such, and must not being
Misrepresented as being the original source code.

3. This notice is removed or altered from any source distribution.

Renényffenegger [email protected]

*/

#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 was provided ' As-is ', without any express or implied
Warranty. In no event would the author be held liable for any damages
arising from the 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 being misrepresented; You must not
Claim that wrote the original source code. If You use the This source code
In a product, an acknowledgment in the product documentation would is
appreciated but isn't required.

2. Altered source versions must is plainly marked as such, and must not being
Misrepresented as being the original source code.

3. This notice is removed or altered from any source distribution.

Renényffenegger [email protected]

*/

#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_;
}

Avimemdc:a C + + class

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.