score:2
you can draw directly on the gc (graphics context) of a new (big) image. having one big image should result in much less resource usage than thousands of smaller images (each image in swt keeps some os graphics object handle)
what you can try is something like this:
final list<image> images;
final image bigimage = new image(display.getcurrent(), combinedwidth, height);
final gc gc = new gc(bigimage);
//loop thru all the images while increasing x as necessary:
int x = 0;
int y = 0;
for (image curimage : images) {
gc.drawimage(curimage, x, y);
x += curimage.getbounds().width;
}
//very important to dispose gc!!!
gc.dispose();
//now you can use bigimage
score:0
presumably not every image is visible on screen at any one time? perhaps a better solution would be to only load the images when they become (or are about to become) visible, disposing of them when they have been scrolled off the screen. obviously you'd want to keep a few in memory on either side of the current viewport in order to make a smooth transition for the user.
score:0
i previously worked with a java application to create photomosaics, and found it very difficult to achieve adequate performance and memory usage using the java imaging (jai) libraries and swt. although we weren't using nearly as many images as you mention, one route was to rely on a utilities outside of java. in particular, you could use imagemagick command-line utilities to stitch together your mosaic, and the load the completed memory from disk. if you want to get fancy, there is also a c++ api for imagemagick, which is very efficient in memory.
Source: stackoverflow.com
Related Query
- SWT Image concatenation or tiling / mosaic
- Remove SWT TreeItem image indent
- Align an image in a SWT TableViewer
- Adding mouse listener to java swt image
- On SWT button, how to position text in front of image
- SWT image button on Mac not working
- Grabbing the inherited background image of a SWT component (Scrolled Composite)
- Path location of the image cannot locate in Eclipse swt
- Eclipse cannot load SWT libraries
- Android/Eclipse: how can I add an image in the res/drawable folder?
- "No system images installed for this target" even though Image is installed
- How do I go about adding an image into a java project with eclipse?
- no cpu/abi system image available for this target
- How do I add an icon as a classpath resource to an SWT window created with WindowBuilder?
- Eclipse Mars: ANT Task references missing SWT library
- A more advanced table/spreadsheet SWT implementation
- Prevent SWT ScrolledComposite from eating part of it's children
- How to overlay an image or view on top of a camera captured image
- SWT Invalid Thread Access on Mac OSX (Eclipse Helios)
- How to get JavaDoc for SWT and JFace in Eclipse?
- How to resize an image when resizing the window in JavaFX
- Build multiple architecture SWT application with Maven
- Adding right click menu to to treeitem in SWT tree
- Browse for image file and display it using Java Swing
- java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM in Windows x86 machine
- uploaded image does not display until I refresh the page Spring Mvc
- How to get Eclipse SWT Browser component running on Ubuntu 11.04 (Natty Narwhal) with Webkit?
- Context menu for TreeViewer based on selected node - SWT
- SWT Browser & Eclipse
- Is there a SWT debugger/spy?
More Query from same tag
- Commenting out code in eclipse adding **** automatically between /* and */
- Ubuntu: Eclipse doesn't see ADT plugin
- Converting existing Java EE project's encoding form ISO-8859-1 to UTF-8
- Eclipse RCP PropertyTester never gets called via menu visibleWhen
- Double button hit
- Vibration after regular intervals
- Failure to transfer failsafe-maven-plugin - Eclipse Luna
- Eclipse can't find Java runtime
- NullPointerException error
- What are the Find and Replace Symbols/Logic in Eclipse IDE for Java Developers 2020-09?
- Error creating PDF in android?
- Admob ads not showing in app
- BULK UPDATE using a File in Eclipse
- not able to find or load main class Files
- BuildShip Gradle plugin on Eclipse, reports "syncrhonize gradle project workspace failed"
- Python Unit Testing in Eclipse only runs one function
- Image gets slightly erased on SWT/Windows
- What is the benefit of WTP
- Maven not adding JAR to project when using mvn compile but does when using mvn eclipse:eclipse
- Error in pom.xml Maven build
- No resource matches com.google.android.gms.version
- SWT Setting Column Height or insert new line
- Unable to use Variable in XPath in Eclipse - Selenium
- Can not Convert to Maven Project in Eclipse
- How to solve "Unresolved inclusion: <iostream>" in a C++ file in Eclipse CDT?
- error aapt: Return code 139 try include library
- Issue when exporting eclipse plugin with linked folder
- Proper way to install SVNKit 1.7.x in Eclipse?
- publishing error in tomcat7
- ScalaTest - java.lang.IncompatibleClassChangeError: Implementing class