Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
请参阅以下PublicAPI方法:
为了使用计量许可功能并通过http/ftp协议加载文档或图像,用户应该向其应用程序添加以下权限
<uses-permission android:name="android.permission.INTERNET" />
public void testPublicAPI1() throws Exception
{
final String imagePath = "myImage.pmg";
Bitmap image = null;
try
{
image = BitmapFactory.decodeFile(imagePath);
DocumentBuilder builder = new DocumentBuilder();
builder.insertImage(image);
}
finally
{
if (image != null)
image.recycle();
}
}
public void testPublicAPI2() throws Exception
{
String gTestDocumentPath = "testDoc.docx";
String outFile = "out.png";
Document doc = new Document(gTestDocumentPath);
Bitmap image = null;
FileOutputStream fos = null;
try
{
image = Bitmap.createBitmap(1000, 1000, Bitmap.Config.ARGB_8888);
Canvas gr = new Canvas(image);
gr.rotate(45);
doc.renderToSize(0, gr, 0, 0, image.getWidth(), image.getHeight());
fos = new FileOutputStream(outFile);
image.compress(Bitmap.CompressFormat.PNG, 100, fos);
}
finally
{
if (fos != null)
fos.close();
if (image != null)
image.recycle();
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.