本文整理汇总了C++中xbox::VJSParms_callStaticFunction::ReturnVValue方法的典型用法代码示例。如果您正苦于以下问题:C++ VJSParms_callStaticFunction::ReturnVValue方法的具体用法?C++ VJSParms_callStaticFunction::ReturnVValue怎么用?C++ VJSParms_callStaticFunction::ReturnVValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbox::VJSParms_callStaticFunction
的用法示例。
在下文中一共展示了VJSParms_callStaticFunction::ReturnVValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _thumbnail
void VJSImage::_thumbnail(XBOX::VJSParms_callStaticFunction& ioParms, VJSPictureContainer* inPict)
{
bool ok = true;
if (!ioParms.IsNumberParam(1))
{
ok = false;
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_NUMBER, "1");
}
if (!ioParms.IsNumberParam(2))
{
ok = false;
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_NUMBER, "2");
}
VPicture* pic = inPict->GetPict();
if (pic != nil && ok)
{
sLONG w = 0, h = 0, mode = 0;
ioParms.GetLongParam(1, &w);
ioParms.GetLongParam(2, &h);
ioParms.GetLongParam(3, &mode);
if (w == 0)
w = 300;
if (h == 0)
h = 300;
if (mode == 0)
mode = 4;
VPicture* thumb = pic->BuildThumbnail(w, h, (PictureMosaic)mode);
if (thumb != nil)
{
VPictureCodecFactoryRef fact;
VPicture* thumb2 = new VPicture();
VError err = fact->Encode(*thumb, L".jpg", *thumb2, nil);
if (err == VE_OK)
{
/*
VJSPictureContainer* pictContains = new VJSPictureContainer(thumb2, true, ioParms.GetContextRef());
ioParms.ReturnValue(VJSImage::CreateInstance(ioParms.GetContextRef(), pictContains));
pictContains->Release();
*/
ioParms.ReturnVValue(*thumb2);
delete thumb2;
}
else
{
delete thumb2;
ioParms.ReturnNullValue();
}
delete thumb;
}
else
ioParms.ReturnNullValue();
}
else
ioParms.ReturnNullValue();
}