![]() ![]() ![]() Use ImageMagick from CLI to resize my image ( stupid as I'm not really using Java anymore ) as the java bindings are kind of instable as I understoodĤ. Load the image using ImageReader, check resolution, use a ImageReadParam to subsample it for a specific ratio, read the BufferedImage using the read method of Imagereader, convert the BufferedImage to javafx imageģ. Write a VC++ program, get total physical ram by calling GlobalMemoryStatusEx for XP or GetPhysicallyInstalledSystemMemory for VISTA/7, run my program using all this ram ( the exe will invoke java -jar -XmxRAM_VALUE and hope it will be enough )Ģ. What solution do you think it's better:ġ. I've tried both solutions and the memory used was about 250MB (for 1024x768) using the image constructor that takes as arguments requestedWidth and requestedHeight but on that image you couldn't zoom without loosing a lot of quality. Can someone give me some hints on how I could do this in Java FX 2, because I don't want to create an application that would crash if an image too big was loaded. I don't want to use that cause it's pretty slow and also I would need conversion to/from awt BufferedImage. In a Swing based app I probably would use an ImageReader, get the image resolution and then subsample it to obtain my desired resolution. Also If a user has 256MB RAM then all would be in vain.īasically I want to scale the image to default screen size resolution but allow the user to upscale the image ( zoom in ) if he wants to. I don't like this solution that much because the JVM crashes if you try to set a value greater that the physical RAM so I would need to write a native program that gets the physical RAM size, and then pass an amount percentage when launching my application using java -jar. If I increase the heap size to 512 then it's ok ( although pretty slow loading ) but of course the memory consumption is 477 MB. Currently, with the default heap size, I receive a OutOfMemoryException for an image 10000 x 5000 pixels. The problem is I would like also to load hi-res images ( like Windows Photo, acdsee viewer does ) without eating up a lot of memory. I plan to write an image viewer application in JavaFX. 1.7K Training / Learning / Certification.165.3K Java EE (Java Enterprise Edition).7.9K Oracle Database Express Edition (XE). ![]() ![]() 3.8K Java and JavaScript in the Database. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |