Kanzi: set picture

There are many places where you need to set pictures. The two methods are for reference only.

1. For fixed image settings, the image can be loaded into the knife memory through the tool, and the tool will generate a texture for us to use, simply save the ResourceID of the texture to set the image, for example image->setProperty(kanzi::Image2D: :ImageProperty, kanzi::ResourceID(imagePath))

2. For the picture of the position, you need to read the picture, and then convert the picture into Texture2D available for GPU. The specific code is as follows

Image->setProperty(Image2D::ImageProperty, Texture);

For Texture,

kzcMemoryManagerCreateSystemManager(&m_memoryManager);

FILE* imageTarget = fopen(strIconPath.c_str(),"rb");

kzcImageLoadResourceFlipped(m_memoryManager,strIconPath.c_str(),&image);

kztexture = Texture::create(domain,image,Texture::CreateFlagClampAddress);

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325472098&siteId=291194637