getImageMode() never called!
Posted: Sat Mar 23, 2013 12:31 pm
So how would you get a tiled/centered image on the panel/wall?
Steema Software - Customer Support Forums
http://teechart.com/support/
It's a public function you can use to check the value of the imageMode property. Internally, it is directly used the imageMode property in thegetImageMode() never called!
Code: Select all
chartEvent
Here you have an example of how to use the CENTER mode:znakeeye wrote:So how would you get a tiled/centered image on the panel/wall?
Code: Select all
private void initializeChart() {
tChart1.getAspect().setView3D(false);
tChart1.getLegend().setVisible(false);
Bar bar1 = new Bar(tChart1.getChart());
bar1.fillSampleValues();
checkExternalStorage();
Image im = null;
if (mExternalStorageAvailable) {
if (mExternalStorageWriteable) {
final File ExtPath = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "Download");
ExtPath.mkdirs();
String path = ExtPath.getAbsolutePath() + File.separator + "flower.jpg";
im = new Image(path);
}
}
ChartImage chIm = new ChartImage(tChart1.getChart());
chIm.setImage(im);
chIm.setImageMode(ImageMode.TILE);
//chIm.setImageMode(ImageMode.CENTER);
}
private boolean mExternalStorageAvailable = false;
private boolean mExternalStorageWriteable = false;
private void checkExternalStorage() {
final String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state) || Environment.MEDIA_SHARED.equals(state)) {
// We can read and write the media
mExternalStorageAvailable = mExternalStorageWriteable = true;
} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
// We can only read the media
mExternalStorageAvailable = true;
mExternalStorageWriteable = false;
} else {
// Something else is wrong. It may be one of many other states, but
// all we need
// to know is we can neither read nor write
mExternalStorageAvailable = mExternalStorageWriteable = false;
}
}