TotalCross / totalcross

TotalCross is a Software Development Kit that helps cross platform application development. Currently supported platforms are: Windows, Wince, Android, iOS, Linux and Linux ARM for embedded systems.
https://www.totalcross.com
GNU Lesser General Public License v2.1
222 stars 40 forks source link

totalcross.ui.image.ImageException: Out of memory #337

Closed nosadaniel closed 3 years ago

nosadaniel commented 3 years ago

Describe the bug

A clear and concise description of what the bug is and the actual behavior.

Devices:

Please complete the following information:

totalcross.ui.image.ImageException: Out of memory at totalcross.ui.image.Image.getSmoothScaledInstance(Image.java:845) at totalcross.ui.image.Image.getHwScaledInstance(Image.java:149) at com.totalcross.knowcode.parse.XmlContainerLayout.createButton(XmlContainerLayout.java:197) at com.totalcross.knowcode.parse.XmlContainerLayout.createInstanceOf(XmlContainerLayout.java:119) at com.totalcross.knowcode.parse.XmlContainerLinearLayout.addscreen(XmlContainerLinearLayout.java:82) at com.totalcross.knowcode.parse.XmlContainerLayout$Handler.tagName(XmlContainerLayout.java:344) at totalcross.xml.XmlReader.reportStartTag(XmlReader.java:534) at totalcross.xml.XmlReader.foundEndEmptyTag(XmlReader.java:343) at totalcross.xml.XmlTokenizer.tokenizeCharacters(XmlTokenizer.java:860) at totalcross.xml.XmlTokenizer.tokenize(XmlTokenizer.java:203) at totalcross.xml.XmlTokenizer.tokenize(XmlTokenizer.java:215) at totalcross.xml.XmlReader.parse(XmlReader.java:221) at com.totalcross.knowcode.parse.XmlContainerLayout.readXml(XmlContainerLayout.java:366) at com.totalcross.knowcode.parse.XmlContainerLayout.initUI(XmlContainerLayout.java:75) at totalcross.ui.Control.setRect(Control.java:1383) at totalcross.ui.Control.setRect(Control.java:655) at totalcross.ui.Window.swap(Window.java:1583) at geiger_toolbox_ui.toolbox_ui.initUI(toolbox_ui.java:20) at totalcross.ui.MainWindow.startProgram(MainWindow.java:501) at totalcross.ui.MainWindow._onTimerTick(MainWindow.java:541) at totalcross.Launcher$WinTimer$1.run(Launcher.java:358) at totalcross.TCEventThread.privatePumpEvents(TCEventThread.java:59) at totalcross.TCEventThread.run(TCEventThread.java:33) java.lang.NullPointerException at java.util.TreeMap.put(TreeMap.java:563) at com.totalcross.knowcode.parse.XmlContainerLayout.createInstanceOf(XmlContainerLayout.java:131) at com.totalcross.knowcode.parse.XmlContainerLinearLayout.addscreen(XmlContainerLinearLayout.java:82) at com.totalcross.knowcode.parse.XmlContainerLayout$Handler.tagName(XmlContainerLayout.java:344) at totalcross.xml.XmlReader.reportStartTag(XmlReader.java:534) at totalcross.xml.XmlReader.foundCharacterData(XmlReader.java:354) at totalcross.xml.XmlTokenizer.tokenizeCharacters(XmlTokenizer.java:872) at totalcross.xml.XmlTokenizer.tokenize(XmlTokenizer.java:203) at totalcross.xml.XmlTokenizer.tokenize(XmlTokenizer.java:215) at totalcross.xml.XmlReader.parse(XmlReader.java:221) at com.totalcross.knowcode.parse.XmlContainerLayout.readXml(XmlContainerLayout.java:366) at com.totalcross.knowcode.parse.XmlContainerLayout.initUI(XmlContainerLayout.java:75) at totalcross.ui.Control.setRect(Control.java:1383) at totalcross.ui.Control.setRect(Control.java:655) at totalcross.ui.Window.swap(Window.java:1583) at geiger_toolbox_ui.toolbox_ui.initUI(toolbox_ui.java:20) at totalcross.ui.MainWindow.startProgram(MainWindow.java:501) at totalcross.ui.MainWindow._onTimerTick(MainWindow.java:541) at totalcross.Launcher$WinTimer$1.run(Launcher.java:358) at totalcross.TCEventThread.privatePumpEvents(TCEventThread.java:59) at totalcross.TCEventThread.run(TCEventThread.java:33) nosakharedanielahanor@MBPvonNosakhare toolbox_ui %

brunoamuniz commented 3 years ago

Hello @nosadaniel,

do you have a sample application simulating the problem? What is the image file you are trying to load?

nosadaniel commented 3 years ago

am using KnowcodeXML library to run my xml file. then it couldn't open the image svg file and i changed it to png, and then the error: out of memory

brunoamuniz commented 3 years ago

Hey @nosadaniel

do you have a sample application simulating the problem? Also, send the image together so we can try it...

What is the device you are trying to run.

nosadaniel commented 3 years ago

Hey @nosadaniel

do you have a sample application simulating the problem? Also, send the image together so we can try it...

What is the device you are trying to run.

Learnt that knowcodeXML doesn't support LinearLayout design... So am using ConstraintLayout and the error disappears.

brunoamuniz commented 3 years ago

Great, thanks for the feedback.

Closing the issue for now