本文整理汇总了C++中Project::AddPhoto方法的典型用法代码示例。如果您正苦于以下问题:C++ Project::AddPhoto方法的具体用法?C++ Project::AddPhoto怎么用?C++ Project::AddPhoto使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project::AddPhoto方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEST(ProjectTests, AddPhotosTest) {
Project project;
for (int i = 0; i < 42; ++i) {
Photo* photo = new Photo;
photo->m_path.SetFullName(wxString::Format(wxT("rui%d.png"), i));
project.AddPhoto(photo);
CHECK_EQUAL(i + 1, project.GetPhotoCount());
}
}
示例2: CHECK
TEST(ProjectTests, ContainsPhotoTest) {
Photo* p1 = new Photo;
Photo p2;
p1->m_path.SetName(wxT("rui"));
p2.m_path.SetName(wxT("rui2"));
Project project;
project.AddPhoto(p1);
CHECK(project.ContainsPhoto(*p1));
CHECK(!project.ContainsPhoto(p2));
}
示例3: resizer
TEST(ProjectTests, UpdatePhotoCrops) {
Resizer resizer(Resizer::RATIO, wxSize(4, 2));
Project project;
project.SetResizer(resizer);
Photo* p1 = new Photo;
p1->m_size = wxSize(42, 42);
project.AddPhoto(p1);
project.UpdatePhotoCrop();
wxRect crop = project.GetPhotoCrop(*p1);
CHECK_EQUAL(wxRect(0, 0, 42, 21), crop);
}