本文整理汇总了C++中One::GetPageRect方法的典型用法代码示例。如果您正苦于以下问题:C++ One::GetPageRect方法的具体用法?C++ One::GetPageRect怎么用?C++ One::GetPageRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类One
的用法示例。
在下文中一共展示了One::GetPageRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadBuffer
bool RasterPlayer::LoadBuffer(const String &buffer) {
if (buffer.IsEmpty())
return false;
StringStream str(buffer);
One<StreamRaster> raster = StreamRaster::OpenAny(str);
if(!raster)
return false;
Stop();
images.Clear();
delays.Clear();
Size sz = raster->GetSize();
ImageDraw iw(sz);
Image previous;
Rect r;
for (int i = 0; i < raster->GetPageCount(); ++i) {
if (previous) {
iw.Alpha().DrawImage(r, previous, GrayColor(255));
iw.DrawImage(r, previous);
previous = Null;
}
raster->SeekPage(i);
r = raster->GetPageRect(i);
switch (raster->GetPageDisposal(i)) {
case 1:
case 2: iw.DrawRect(r, SColorFace());
break;
//case 2: iw.DrawRect(sz, White()); // It seems gif files do not comply with standard
// break;
case 4: if (i > 0)
previous = GetRect_(images[i-1], r);
iw.DrawRect(sz, SColorFace());
break;
}
iw.Alpha().DrawImage(r.left, r.top, raster->GetImage(0, 0, r.right-r.left, r.bottom-r.top), GrayColor(255));
iw.DrawImage(r.left, r.top, raster->GetImage(0, 0, r.right-r.left, r.bottom-r.top));
images.Add(iw);
delays.Add(max(50, 10*raster->GetPageDelay(i)));
}
ind = 0;
return true;
}