Because in the work based on Thunderbolt bolt development is IM products, need to implement the function of custom user picture.
But Bolt in the image of the default stretch sawtooth effect is very obvious, so that they implement the image stretching function, the code has been shared, to see: "Thunderbolt bolt image stretching unclear solution."
However, in the use of this function, encountered the use of clipsubbindbitmap cut and then stretched, the image does not display the bug, the sample code:
Hcutbitmap Although not empty, but does not show, and later with Longge (Phantom Gray Dragon) communication, notice the bitmap class Clipsubbindbitmap function Description:
Clipsubbindbitmap returns the bitmap is a sub-object, sharing data with the original bitmap, that is, cutting out bitmap is not the true meaning of the image, so resulting in subsequent stretch bugs.
The solution is also very simple, called the clone function, to create a true sense of bitmap.
After using Clipsubbindbitmap, if you need to do other processing of the image, you can clone one first.
In addition, there is an error in the official interpretation of the object reference count in communication: http://xldoc.xl7.xunlei.com/0000000018/00000000180001000010.html
Checkxxx does not increase the reference count, just takes the object out of the LUA stack.
Sharing, is a natural impulse!
Clipsubbindbitmap function of Thunderbolt Bolt special description