0

我正在为我越狱的 iPhone 创建一个 Theos 调整,但我被困在一个功能上。到目前为止,我可以阻止屏幕截图检测和重放检测,添加无限文本,并将应用程序直接打开到提要。我坚持的功能是保存传入和传出的快照(和故事,但一次一步)。我使用 Cydia 的 FLEXible 调整来帮助我,我注意到快照与“UIImage”有关。据我所知,我必须以某种方式将此 UIImage 转换为 *.jpg 或 *.png 并将其保存在某处(我希望将其保存到应用程序的 Documents 目录中)。

我在该网站上进行了搜索,发现以下内容可能会有所帮助:

// Convert UIImage to JPEG
NSData *imgData = UIImageJPEGRepresentation(image, 1); // 1 is compression quality

// Identify the home directory and file name    
NSString  *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Test.jpg"]; 

// Write the file.  Choose YES atomically to enforce an all or none write. Use the NO flag if partially written files are okay which can occur in cases of corruption
[imgData writeToFile:jpgPath atomically:YES]; 

// Create paths to output images
NSString  *pngPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Test.png"];
NSString  *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Test.jpg"];

// Write a UIImage to JPEG with minimum compression (best quality)
// The value 'image' must be a UIImage object
// The value '1.0' represents image compression quality as value from 0.0 to 1.0
[UIImageJPEGRepresentation(image, 1.0) writeToFile:jpgPath atomically:YES];

// Write image to PNG
[UIImagePNGRepresentation(image) writeToFile:pngPath atomically:YES];

(就像我说的我找到了这个;这不是我的代码)。

呸,我不知道我会如何融入这个。有什么帮助吗?

4

0 回答 0