The effect of the image stretching in the Thunderbolt Bolt Library is more severe, and is often caused by aliasing:
1, in the use of Imageobject, DrawMode for 1 stretch mode;
2, using the stretch function of bitmap class to stretch the image;
Although Imageobject has the AntiAlias attribute to support anti-aliasing, there is no particularly significant optimization effect after setup.
The way to solve the aliasing is to write the tensile function in C + +, you can refer to the processing function I wrote:
int Cxluacimpl::stretchbitmap (lua_state* luastate) {XL_BITMAP_HANDLE HXLBitmap = Null;if (Xlue_checkbitmap (luastate, 2, &hxlbitmap)) {int nwidth = Lua_tointeger (luastate,3); int nheight = Lua_ Tointeger (luastate,4); CImage oldimage; CImage NewImage; Hbitmap hbitmap = Transparentimage (Xlgp_convertxlbitmaptodib (Hxlbitmap, +)); Oldimage.attach (HBITMAP); if (! Newimage.createex (nwidth, nheight, Bi_rgb)) {Oldimage.detach (); return 0;} int npremode =:: Setstretchbltmode (NEWIMAGE.GETDC (), halftone); Newimage.releasedc (); Oldimage.draw (NewImage.GetDC () , 0, 0, nwidth, nheight, 0, 0, oldimage.getwidth (), Oldimage.getheight ()); Newimage.releasedc ();:: Setbrushorgex ( NEWIMAGE.GETDC (), 0, 0, NULL); Newimage.releasedc ();:: Setstretchbltmode (Newimage.getdc (), Npremode); Newimage.releasedc (); OldImage.Detach (); Hxlbitmap = Xlgp_convertddbtoxlbitmap (CClientDC (NULL), Newimage.detach (), XLGRAPHIC_CT_ARGB32); Xlue_pushbitmap (Luastate,hxlbitmap); return 1;} return 0;}
The function does not use a professional processing algorithm, but the sawtooth is obviously improved to meet the daily needs.
Record, for the better of myself!
The solution to the image drawing of Thunderbolt bolt is not clear