         let topUIImage = UIImage(ciImage: topCIImage)
         
         // 変形対象部分を切る.
-        let frameVector = CIVector(cgRect:CGRect(x: 0, y: 300, width: inputImage.extent.size.width, height: 200))
+        let frameVector = CIVector(cgRect:CGRect(x: 0, y: 500, width: inputImage.extent.size.width, height: 200))
+//        let frameVector = CIVector(cgRect: CGRect(x: 0, y: partRect.origin.y, width: inputImage.extent.size.width, height: partRect.height))
         guard let cropFilter = CIFilter(name: "CICrop") else { return inputImage }
         cropFilter.setDefaults()
         cropFilter.setValue(inputImage, forKeyPath: kCIInputImageKey)

        guard let filter = CIFilter(name: "CIStretchCrop") else {return inputImage}
        filter.setDefaults()
        filter.setValue(cropOutputImage, forKeyPath: kCIInputImageKey)
        filter.setValue(value, forKeyPath: "inputCenterStretchAmount")
        filter.setValue(0, forKeyPath: "inputCropAmount")
        guard let outputImage = filter.outputImage else {return inputImage}

        // 三つの部分を併合する.
        UIGraphicsBeginImageContext(UIScreen.main.bounds.size)
        
        topUIImage.draw(in: CGRect(x: 0, y: 0, width: screenWidth, height: screenHeight - 700 * screenHeight / inputImage.extent.height))
        outputUIImage.draw(in: CGRect(x: 0, y: screenHeight - 700 * screenHeight / inputImage.extent.height, width: screenWidth, height: 200 * screenHeight / inputImage.extent.height))
        bottomUIImage.draw(in: CGRect(x: 0, y: screenHeight - 500 * screenHeight / inputImage.extent.height, width: screenWidth, height: 500 * screenHeight / inputImage.extent.height))
        
//        topUIImage.draw(in:CGRect(x: 0, y: 0, width: screenWidth, height: screenHeight - (partRect.origin.y + partRect.height) * screenHeight / inputImage.extent.height))
//        outputUIImage.draw(in: CGRect(x: 0, y: screenHeight - (partRect.origin.y + partRect.height) * screenHeight / inputImage.extent.height, width: screenWidth, height: (partRect.origin.y + partRect.maxY) * screenHeight / inputImage.extent.height))
//        bottomUIImage.draw(in: CGRect(x: 0, y: screenHeight - partRect.origin.y * screenHeight / inputImage.extent.height, width: screenWidth, height: partRect.origin.y * screenHeight / inputImage.extent.height))
        
        
        guard let resultUIImage = UIGraphicsGetImageFromCurrentImageContext() else {return inputImage}
        UIGraphicsEndImageContext()
        
        let resultCIImage = CIImage(image: resultUIImage)
        return resultCIImage
    }
    
//    
