本文整理汇总了C++中TBitmap::Width方法的典型用法代码示例。如果您正苦于以下问题:C++ TBitmap::Width方法的具体用法?C++ TBitmap::Width怎么用?C++ TBitmap::Width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBitmap
的用法示例。
在下文中一共展示了TBitmap::Width方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CelSize
//
/// Add new cel(s) to the CelArray - return index of new addition.
/// No mask bitmap is added.
//
int
TCelArray::Add(const TBitmap& image)
{
int width = image.Width();
int count = width / CelSize().cx;
if (!MaybeResize(count))
return -1;
OwlCopyBmp(*Bitmap, image, CelOffset(NCelsUsed,0), image.Size());
int index = NCelsUsed;
NCelsUsed += count;
TRACEX(OwlGadget, 1, "TCelArray @" << (void*)this << " added bitmap @" <<
(void*)&image);
return index;
}
示例2: TSize
//
/// Constructs a TImageList from a bitmap, slicing it up into a horizontal array of
/// the given number of evenly sized images.
// !CQ add an optional mask color? or mask?
//
TImageList::TImageList(const TBitmap& bmp, uint flags, int imageCount, int growBy)
{
if (!TCommCtrl::IsAvailable())
TXCommCtrl::Raise();
if (!imageCount)
imageCount = 1;
ImageSize = TSize(bmp.Width() / imageCount, bmp.Height());
Bitmap = 0;
Handle = TCommCtrl::Dll()->ImageList_Create(ImageSize.cx, ImageSize.cy,
flags, imageCount, growBy);
CheckValid();
WARNX(OwlCommCtrl, !Handle, 0, "Cannot create ImageList");
// Use masked support with 3dFace color as background color
//
Add(bmp, TColor::Sys3dFace); // !CQ
}