这是一个后续问题 -从左到右的梯度方向
在这个苹果反射示例代码中,
当大小滑块移动时,图像从下到上剪切。移动滑块时如何将其从上到下剪切?我试图更好地理解本教程
//I know the code is in this section here but I can't figure out what to change
- (UIImage *)reflectedImage:(UIImageView *)fromImage withHeight:(NSUInteger)height
{
...
}
//it probably has something to do with this code.
//I think this tells it how much to cut.
//Though I can't figure out how does it know where the 0,0 of the image is and why
// keep 0,0 of the image on the top? I am assuming this is where it hinges its
//point and cuts the image from bottom to top
CGContextRef MyCreateBitmapContext(int pixelsWide, int pixelsHigh)
{
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
// create the bitmap context
CGContextRef bitmapContext = CGBitmapContextCreate (NULL, pixelsWide, pixelsHigh, 8, 0, colorSpace,(kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst));
CGColorSpaceRelease(colorSpace);
return bitmapContext;
}
如果要反映的图像在顶部怎么办。所以为了正确地展示它,我需要从上到下展示它,而不是自下而上。那就是我想要达到的效果。在这种情况下,我只是在他们的故事板示例中移动了 UIImageViews。你现在看到了我的困境