If you think the Android project RadaeePDF-B4A listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.radaee.pdf;
/*www.java2s.com*/import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
/**
class for hand-writing ink.<br/>
not same to Ink class, this class has max line width and min line width.<br/>
so the line in HWriting will not in same width.
@author Radaee
@version 1.1
*/publicclass HWriting
{
protectedint hand = 0;
private Bitmap m_bmp;
privatestaticnativeint create( int w, int h, float min_w, float max_w, int clr_r, int clr_g, int clr_b );
privatestaticnativevoid onDown( int hand, float x, float y );
privatestaticnativevoid onMove( int hand, float x, float y );
privatestaticnativevoid onUp( int hand, float x, float y );
privatestaticnativevoid onDraw( int hand, int bmp );
privatestaticnativevoid destroy( int hand );
/**
* constructor for hand-writing.
* @param w width of cache.
* @param h height of cache.
* @param min_w min-width for ink width.
* @param max_w max-width for ink width.
* @param clr_r r values of ink color [0-255]
* @param clr_g g values of ink color [0-255]
* @param clr_b b values of ink color [0-255]
*/public HWriting( int w, int h, float min_w, float max_w, int clr_r, int clr_g, int clr_b )
{
hand = create( w, h, min_w, max_w, clr_r, clr_g, clr_b );
m_bmp = Bitmap.createBitmap(w, h, Config.ARGB_8888);
}
/**
* destroy and free memory.
*/publicvoid Destroy()
{
destroy( hand );
hand = 0;
m_bmp.recycle();
}
/**
* call when click down
* @param x x value of point in this object.
* @param y y value of point in this object.
*/publicvoid OnDown( float x, float y )
{
onDown( hand, x, y );
}
/**
* call when moving
* @param x x value of point in this object.
* @param y y value of point in this object.
*/publicvoid OnMove( float x, float y )
{
onMove( hand, x, y );
}
/**
* call when click up
* @param x x value of point in this object.
* @param y y value of point in this object.
*/publicvoid OnUp( float x, float y )
{
onUp( hand, x, y );
}
/**
* draw to locked bitmap handle.
* @param bmp, obtained by Global.lockBitmap()
*/publicvoid OnDraw( int bmp )
{
onDraw( hand, bmp );
}
}