【问题标题】:Objective c image set size is not distortedObjective c 图像集大小不失真
【发布时间】:2017-08-03 10:57:09
【问题描述】:

当我混合 2 图像宽度 GPUImage 2 图像自动修复相同大小的主图像。但主图像尺寸水平或垂直顶部图像失真。
我尝试使用图像矢量,设置新尺寸并使用九个补丁,但新图像框架没有不同。你有答案可以帮助我。


谢谢!



这是我的代码

-(UIImage*)imageBlendFrameDefault:(UIImage *)blenFrame{
    GPUImagePicture *mainPicture = [[GPUImagePicture alloc] initWithImage:_inputImage];
    GPUImagePicture *topPicture = [[GPUImagePicture alloc] initWithImage:blenFrame];

    GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init];

    [blendFilter setMix:0.8];

    [mainPicture addTarget:blendFilter];
    [topPicture addTarget:blendFilter];


    [mainPicture processImage];
    [topPicture processImage];

    [blendFilter useNextFrameForImageCapture];

    UIImage * mergedImage = [blendFilter imageFromCurrentFramebuffer];
    return mergedImage;
}

【问题讨论】:

  • 能否请您添加您已经尝试过的代码?
  • 我添加了这段代码。你可以帮助我
  • 您无法对这些图像做您想做的事情。 “框架”必须拉伸,或者图像必须拉伸。您需要重新设计您的框架,以便您可以拍摄四个单独的角,以及侧面的“可拉伸”或“可重复”图像。
  • 谢谢 DonMag 对我的问题很感兴趣。现在很晚了,明天我会试试你的解决方案

标签: ios objective-c uiimage gpuimage


【解决方案1】:

使用 UIGraphicsBeginImageContextWithOptions 剪切框架

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-22
    • 2011-05-13
    • 2014-04-10
    • 2012-05-07
    • 2018-10-06
    • 2020-01-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多