Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
jooora
jooora's Profile
2
Posts
7
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Image inside a polygon with java2D
[3 Replies]
07-Jun-2013 03:20 AM
Forum:
Programming Questions
Hi,
i'd like to display a shape (polygon) with an image inside.
There is the texture function with openGL graphics, but even with smooth(n) the render is too ugly.
The only nice render is the native one (Java2D).
But I didn't find any way to display my image inside a polygon with java2D:
- texture not available
- createshape not available
I tried to make a shape with a whole to hide the part of the image I don't want to show, but I didn't success...
I tried this but even the whole is filled:
fill(0,0,0,255);
g.rect(0,0,300,300);
fill(255,255,255,255);
beginShape();
// Exterior part of shape
beginContour();
vertex(50,50);
vertex(250,50);
vertex(250,250);
vertex(50,250);
vertex(50,50);
endContour();
// Interior part of shape
beginContour();
vertex(140,140);
vertex(160,140);
vertex(160,160);
vertex(140,160);
vertex(140,140);
endContour();
// Finishing off shape
endShape(CLOSE);
Any idea?
loadimage, big images and memory...
[15 Replies]
17-Aug-2012 04:08 PM
Forum:
General Discussion
Hi!
I have to show a picture of
8624 x 12545px.
My program can display it with a few memory by storing it to disk with a sort of "quad tree" structure (a lot of smaller images).
My problem comes the first time I load the big image:
To store it as a bunch of small files,
I have to load it at least once, without displaying it. (only cut & save).
But this operation "PImage img = loadImage(theBigPic.png)" uses
too much memory
.
So that I get the exception "java.lang.OutOfMemoryError: Java heap space".
I upped the JVM max memory space to 1500Mo (can't put more, or the jvm cannot be instancied).
So I'd like to find a way to load the image using less memory space. (I don't need to keep transparency, and I don't need to display it). Any Idea?
«Prev
Next »
Moderate user : jooora
Forum