Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
59
rated 0 times [  64] [ 5]  / answers: 1 / hits: 18889  / 11 Years ago, wed, october 2, 2013, 12:00:00

I write this javascript code :



context.shadowOffsetX = 5;
context.shadowOffsetY = 5;
context.shadowBlur = 4;
context.shadowColor = 'rgba(255, 0, 0, 0.5)';
context.fillStyle = '#f00';
context.fillRect(x, y, w, h);


I add this script on a photo , I want see the color of image , but can not add transparency to this script .


More From » html

 Answers
36

Try making the fillStyle RGBA, too.



context.fillStyle = 'rgba(255, 0, 0, 0.5)';
context.fillRect(x, y, w, h);

[#75286] Tuesday, October 1, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryankiah

Total Points: 183
Total Questions: 99
Total Answers: 112

Location: Christmas Island
Member since Mon, Oct 19, 2020
4 Years ago
;