图片的翻转是利用到stretchBlt函数,我自己理解是一个图片象素的copy
bitmap:=tbitmap.create;
bitmap.assign(image1.picture.bitmap);
stretchBlt(bitmap.canvas.handle,0,0,image1.width,image1.height,image1.canvas.handle,第7参数,第8参数,第9参数,第10参数,srccopy);
//第7,8参数为要copy区域的原点,第9,10,分别为width和height,通过×(-1)可完成图片的翻转,-1应该是象素位置的递减吧。
image1.canvas.draw(0,0,bitmap);//image1的重绘
bitmap.free;
//bitmap可视为一个进行缓存的作用,记得要释放掉
心得:利用stretchblt可实现上下左右的翻转
问题:将image1的stretch设置为true则效果变差了
|