public class SpenCapturePage extends Object implements SpenCapturePageInterface
| Constructor and Description |
|---|
SpenCapturePage(Context context)
Creates an SpenCapturePage instance.
|
| Modifier and Type | Method and Description |
|---|---|
Bitmap |
capturePage(float ratio)
Get the bitmap of the current page at the specified resizing ratio.
|
Bitmap |
captureRect(RectF rect)
Get the bitmap of the specified area.
|
void |
close()
Close the captured page.
|
void |
compressPage(String filename,
float ratio)
Compress the current page into a PNG file with the specified file name and the specified resizing ratio.
|
boolean |
isHyperTextViewEnabled()
Check if the hypertext view is enabled.
|
boolean |
isThumbnailEnabled()
Check if the thumbnail is enabled.
|
void |
setHyperTextViewEnabled(boolean enable)
Enable or disable the hypertext view.
|
void |
setPageDoc(SpenPageDoc pageDoc)
Set the specified SpenPageDoc instance.
|
void |
setThumbnailEnabled(boolean enable)
Enable or disable storing the thumbnail.
|
public SpenCapturePage(Context context)
context - The Context for your application.public void setPageDoc(SpenPageDoc pageDoc)
setPageDoc in interface SpenCapturePageInterfacepageDoc - The SpenPageDoc instance.public void compressPage(String filename, float ratio)
compressPage in interface SpenCapturePageInterfacefilename - The file name for the PNG file that you want to createratio - The resizing ratio for the PNG file.
Ratio must be greater than 0 and below 5. ( 0 < ratio <= 5)OutOfMemoryError - if not enough memory to create compress bitmapIllegalArgumentException - if create bitmap with size exceeds 32bits
or if create bitmap failed when invalid datapublic Bitmap captureRect(RectF rect)
captureRect in interface SpenCapturePageInterfacerect - The area to capture.OutOfMemoryError - thrown if not enough memory to create captured .public Bitmap capturePage(float ratio)
capturePage in interface SpenCapturePageInterfaceratio - The ratio when capture pageOutOfMemoryError - thrown if not enough memory to create captured bitmap.public void close()
close in interface SpenCapturePageInterfacepublic void setHyperTextViewEnabled(boolean enable)
setHyperTextViewEnabled in interface SpenCapturePageInterfaceenable - Set to true to enable the hypertext view, set to false to disable the hypertext view.public boolean isHyperTextViewEnabled()
isHyperTextViewEnabled in interface SpenCapturePageInterfacepublic void setThumbnailEnabled(boolean enable)
setThumbnailEnabled in interface SpenCapturePageInterfaceenable - Set to true to enable the thumbnail, set to false to disable the thumbnail.public boolean isThumbnailEnabled()
isThumbnailEnabled in interface SpenCapturePageInterface