--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/606090c0-1d5a-4f23-bd61-514ea96ebc06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
What line is the exception thrown on. Your snippet shows you drawing to the Graphics context you obtained from "last" but you don't show what "last" is. My guess is "last" is not a mutable image.
On Tue, Jul 1, 2014 at 7:43 AM, <emil.h....@gmail.com> wrote:
I need an interactive chart, specifically to be able to draw labels on bars when the user clicks them. To get a good performance, i reuse the rendered chart image (rendered using aChartEngine) and draw the labels on top on a copy afterwards. The code looks something like thispublic Image modifyImage(Image base, String s, int x, int y) {Image copy = Image.createImage(base.getRGB(), base.getWidth(), base.getHeight());Graphics g = last.getGraphics();g.drawString(s, x, y);return copy;}The code works perfectly in the simulator and on iOS, but not on Android. On Android an IllegalStateException: Immutable bitmap passed to Canvas constructor is thrown. The solution in "native Android" can be found here, but what to do in CN1?If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device
--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/606090c0-1d5a-4f23-bd61-514ea96ebc06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[EDT] 0:0:6,779 - Exception: java.lang.IllegalStateException - Immutable bitmap passed to Canvas constructor java.lang.IllegalStateException: Immutable bitmap passed to Canvas constructor at android.graphics.Canvas.<init>(Canvas.java:83) at com.codename1.impl.android.AndroidImplementation.o(AndroidImplementation.java:1090) at com.codename1.i.p.h(Image.java:652) at dk.emhermunk.b.a.b.a(ChartViewCountModifier.java:41) at dk.emhermunk.b.a.c$1.c(ChartViewImpl.java:41) at com.codename1.i.n.c(Form.java:1997) at com.codename1.i.g.e(Component.java:2494) at com.codename1.i.k.l(Display.java:1862) at com.codename1.i.k.j(Display.java:999) at com.codename1.i.k.i(Display.java:930) at com.codename1.i.y.run(RunnableWrapper.java:120) at com.codename1.impl.b$1.run(CodenameOneThread.java:60) at java.lang.Thread.run(Thread.java:1096)
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/7b7f033f-05e0-4c90-be31-d46fd3d8c22e%40googlegroups.com.
[EDT] 0:2:7,556 - Exception thrown on EDT! [EDT] 0:2:7,561 - Exception: java.lang.IllegalStateException - Immutable bitmap passed to Canvas constructor java.lang.IllegalStateException: Immutable bitmap passed to Canvas constructor at android.graphics.Canvas.<init>(Canvas.java:83) at com.codename1.impl.android.AndroidImplementation.getNativeGraphics(AndroidImplementation.java:1090) at com.codename1.ui.Image.getGraphics(Image.java:652) at dk.emhermunk.gui.charts.ChartViewCountModifier.determineImage(ChartViewCountModifier.java:41) at dk.emhermunk.gui.charts.ChartViewImpl$1.pointerPressed(ChartViewImpl.java:41) at com.codename1.ui.Form.pointerPressed(Form.java:1997) at com.codename1.ui.Component.pointerPressed(Component.java:2494) at com.codename1.ui.Display.handleEvent(Display.java:1862) at com.codename1.ui.Display.edtLoopImpl(Display.java:999) at com.codename1.ui.Display.mainEDTLoop(Display.java:930) at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120) at com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60) at java.lang.Thread.run(Thread.java:1096)
Use of the new graphics pipeline sounds great! Is there any ETA? BTW, I also noticed a performance increase running on iOS 8 (beta) compared to iOS 7.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/606090c0-1d5a-4f23-bd61-514ea96ebc06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Steve HannahWeb Lite Solutions Corp.
--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/7b7f033f-05e0-4c90-be31-d46fd3d8c22e%40googlegroups.com.