File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
Text to Bitmap convertion
Joined: Aug 08, 2008
Aug 27, 2009 05:54:50
hi can anybody please tell me how to generate a bitmap file from text entered in Jtextfield
.i need a wirless bitmap format.
Actually i am using this code
private Bitmap getScaledBitmapImage(
imagename, int ratioX, int ratioY)
EncodedImage image = EncodedImage.getEncodedImageResource(imagename);
int currentWidthFixed32 = Fixed32.toFP(image.getWidth());
int currentHeightFixed32 = Fixed32.toFP(image.getHeight());
double ratio = (double)ratioX / (double) ratioY;
double w = (double) image.getWidth() * ratio;
double h = (double)image.getHeight() * ratio;
int width = (int) w;
int height = (int) h;
int requiredWidthFixed32 = Fixed32.toFP(width);
int requiredHeightFixed32 = Fixed32.toFP(height);
int scaleXFixed32 = Fixed32.div(currentWidthFixed32, requiredWidthFixed32);
int scaleYFixed32 = Fixed32.div(currentHeightFixed32, requiredHeightFixed32);
image = image.scaleImage32(scaleXFixed32, scaleYFixed32);
but it is not recognising Bitmap and EncodedImage classes .i do not why please help me
Joined: Mar 22, 2005
Aug 27, 2009 06:02:31
Where does this code come from? The standard Java class libraries do not have Bitmap, Fixed32 and EncodedImage image classes, so you need to include whichever library has those in your classpath.
This blog entry should be of interest:
Ping & DNS
- updated with new look and Ping home screen widget
Joined: Aug 08, 2008
Aug 27, 2009 23:39:23
Thanks for your reply
Joined: Jul 26, 2007
Aug 27, 2009 23:44:50
satyasri ch wrote:
Like you have been told before, please check your private messages for an important administrative matter.
How to ask questions
Donate a pint, save a life!
Onff-turn it on!
It is sorta covered in the
JavaRanch Style Guide
subject: Text to Bitmap convertion
get image from URL using inputstream
Question about drawimage
Resizing images with higher DPI makes them dark
topic is on images
load image using mediatracker
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014