11-04-2011 03:34 AM
Hi all,
In my application for Blackberry 5.0, i want to draw text vertically along Y axis. Can any one help me out?
Please see the image below for refrence.
Thanks,
YoGi
11-04-2011 03:55 AM
11-04-2011 05:32 AM
I'm not up to the maths involved but RexDoug is, and he has posted a solution to your problem (as I understand it) here:
Not sure if these help, I think they end up in the same place.
http://supportforums.blackberry.com/t5/Java-Develo
http://supportforums.blackberry.com/t5/Java-Develo
01-02-2012 08:29 AM - last edited on 01-02-2012 08:42 AM
use this code.....
i have use this code to display the text like you want
VerticalFieldManager vfm = new VerticalFieldManager(USE_ALL_HEIGHT | USE_ALL_WIDTH)
{
protected void paint(Graphics graphics)
{
// graphics.drawBitmap(0, 0, 33, 138, dateImg_c, 0, 0);
{
int thetaFixed = Fixed32.toFP(90);
int cell_11 = Fixed32.cosd(thetaFixed);
int cell_12 = -Fixed32.sind(thetaFixed);
int cell_21 = Fixed32.sind(thetaFixed);
int cell_22 = Fixed32.cosd(thetaFixed);
int[] transform = new int[] { cell_11, cell_12, cell_21, cell_22, 0, 0 };
Font myFont = Font.getDefault().derive(Font.BOLD, 17, Ui.UNITS_px, Font.ANTIALIAS_STANDARD, 0, transform);
graphics.setFont(myFont);
graphics.setColor(Color.WHITE);
graphics.drawText("Vertical text drawn", X-position of text, Y-position of text);
}
super.paint(graphics);
}
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(X-position, Y-position);
setExtent(X-position, Y-position);
}
};
just manage your X-position and Y-position as you want
thanks and regards
Nitish Subudhi