Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Zoho Docs
Google Docs
Each Attachment size should not exceed 1MB.
Max no of attachments : 0
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
New to this Portal?
Click on Join Now to Sign Up
Join Now
Help
Feedback
Sign In
Processing Forum
Recent Topics
All Forums
Search All
Tags
Author
Advanced Search
Search
New Topic
Screen name:
titi_lucky
titi_lucky's Profile
1
Posts
2
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
the pixels of PImage can not be modified in browsers
[5Replies]
09-Jan-2012 07:39 AM
Forum:
Processing with Other Languages
My codes can be running as expected in processing app. However it does not work in browsers (e.g firefox, IE, google chrome etc.) if I use them as JS in HTML.
<p><canvas id="canvas1" width="200" height="200"></canvas></p>
<script type="application/processing" data-processing-target="canvas1">
/* @pjs preload="../images/im.jpg"; */
PImage img = loadImage("../images/im.jpg");
int dimension = (img.width*img.height);
img.loadPixels();
for (int i=0; i < dimension; i+=2) {
img.pixels[i] = color(80, 80, 80);
}
img.updatePixels();
image(img, 0, 0);
/*color pink = color(255, 102, 204);
loadPixels();
for (int i = 0; i < (width*height/2)-width/2; i++) {
//println(pixels[i]);
pixels[i] = pink;
}
updatePixels();*/ // this parts of code can be worked in browsers
</script>
«Prev
Next »
Moderate user : titi_lucky
Forum