草庐IT

low-graphics

全部标签

objective-c - 有没有办法使用 iOS 的 Core Graphics 将 PDF 转换为受密码保护和加密的文件?

标题如是说:我想在iOS5设备上打开一个PDF,在其上设置一个密码,然后使用AES256加密将其保存回来,如Adob​​e的PDF规范中所述。我知道使用CoreGraphics打开和阅读PDF很容易,但是如何保存/转换它们并设置限制(不能打开、不能打印、不能复制……)呢? 最佳答案 是的,您可以使用CoreGraphics创建加密的PDF文件。CGPDFContextCreate方法允许您在auxiliaryInfo参数中指定密码、访问权限和key大小。仅支持AllowCopy和AllowPrint访问权限。文档将使用RC4算法进行

ios - 如何在使用 Core Graphics 绘制的图像上设置辅助功能标签?

我正在尝试围绕一些核心图形逻辑编写UIAutomation测试。目前我们正在使用核心图形来绘制图像。我正在尝试在图像上设置可访问性标签/标识符/值,以便我可以通过UIAutomation测试验证它的存在,但无论我做什么,我都没有在DOM中获得可访问性标签/标识符/值我的测试。以下是我尝试过的事情:直接在图片上设置。UIImage*uiImage=[UIImageimageWithData:bfCaseStudy.image];uiImage.isAccessibilityElement=YES;uiImage.accessibilityLabel=bfCaseStudy.name;ui

php - 在哪里可以找到触发 unset() 垃圾回收的 "low memory"和 "free CPU cycles"调用?

在解释PHPunset()不会立即触发“垃圾收集”时,我经常发现引用了以下引用,但只有在它认为合适时才触发(强调我的):unset()doesjustwhatit'snamesays-unsetavariable.Itdoesnotforceimmediatememoryfreeing.PHP'sgarbagecollectorwilldoitwhenitseefits-byintentionassoon,asthoseCPUcyclesaren'tneededanyway,oraslateasbeforethescriptwouldrunoutofmemory,whateverocc

android - 适用于 Android 的 AzureAD 抛出 ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED

我有一个应用程序,用户在Office365中使用AzureADlibraryforAndroid进行身份验证.它运作良好,用户可以验证并使用该应用程序。不幸的是,过了一会儿,他们开始使用ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED作为错误代码命中AuthenticationException。我检查了sourcecodeAzurelAD。唯一解决这个问题的地方是acquireTokenAfterValidation()方法:privateAuthenticationResultacquireTokenAfterValidation(C

Android Bluetooth Low Energy 获取对特定请求的响应

使用Gatt与BLE设备通信时,我不太明白。根据这个:https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#connectGatt(android.content.Context,boolean,android.bluetooth.BluetoothGattCallback)BluetoothGattgatt=device.connectGatt(context,true,newBluetoothGattCallback(){....})我可以连接到BLE设备并给它一个回调对象,以便

android - 尝试在空对象引用上调用虚拟方法 'void android.graphics.Bitmap.copyPixelsFromBuffer(java.nio.Buffer)'

我有一个ImageView我正在从中获取位图,然后使用copyPixelstoBuffer并将它复制到buffer_temp,现在我想使用反向算法再次将其转换为另一个位图,然后从该位图转换为ImageView2,我正在做的是使用Buffer在ImageView中复制图像并将其粘贴到另一个Imageview使用Buffer,但在复制copyPixelsFromBuffer时总是抛出java.lang.NullPointerException:Attempttoinvokevirtualmethod'voidandroid.graphics.Bitmap.copyPixelsFromBuf

android - android.graphics.Canvas 中的 drawPosText(),什么是起源?

drawPosText(char[]text,intindex,intcount,float[]pos,Paintpaint)Drawthetextinthearray,witheachcharacter'soriginspecifiedbytheposarray.有谁知道drawPosText认为“原点”的确切位置,因为您将“原点”指定为坐标对;即,它是字符的左下角,中心,什么?还有drawPosText绘制时如何计算字符高度? 最佳答案 啊,我昨天花了一大块时间在让一些文本居中!如果您左对齐,文本原点是左下角。如果您采用居中对齐

android - java.lang.NoSuchMethodError : No static method getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable; 错误

我将AndroidStudio更新到2.2,我的项目将不再构建。我的Activity的super.onCreate(savedInstanceState)给我一个错误:java.lang.NoSuchMethodError:NostaticmethodgetDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;inclassLandroid/support/v4/content/ContextCompat;oritssuperclasses(declarationof'android.suppor

Android: java.lang.NullPointerException at android.graphics.Canvas.drawLine(Canvas.java:809) (可能与我的可绘制资源有关)

我正在尝试构建一个包含7列和每列24个TextView的subview。当我的Activity开始时出现异常,并且它在堆栈跟踪中的任何位置都没有我的包。这是24个TextView中每个View的背景可绘制资源在此之前,CPU会达到100%一两秒。我正在使用Android2.2的模拟器这是我的异常(exception)。01-2616:51:38.084:ERROR/AndroidRuntime(955):FATALEXCEPTION:main01-2616:51:38.084:ERROR/AndroidRuntime(955):java.lang.NullPointerExceptio

Android:字节分配内存不足(android.graphics.Bitmap)

我的应用程序在后台闲置了一段时间后,我将其重新显示在View中,我注意到它非常慢,然后就是没有响应。然后我检查了logcat,我看到了“557296字节分配内存不足”。在我的应用程序闲置之前,我做的最后一件事是向数据库中的几个表添加几条记录。但是,内存错误之前我的logcat中的最后一行与位图有关?..."android.graphics.Bitmap.createBitmap"。我不确定如何开始追踪它。11-0720:32:22.940:D/PMS(599):acquireWL(42e31570):PARTIAL_WAKE_LOCKCM_static0x1138571016611-0