in Education by
In HTML5 when we want to fill shape by radial gradient we use: ctx.createRadialGradient(centerX1, centerY1, radius1, centerX2, centerY2, radius2); but this fill shapes by circular radial gradient. How to fill it by elliptic radial gradient? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Transform the canvas context before you draw the gradient (example): var c = document.getElementById('mycanvas'); var ctx = c.getContext('2d'); var radgrad = ctx.createRadialGradient(100,100,20,100,100,50); radgrad.addColorStop(0, '#A7D30C'); radgrad.addColorStop(0.9, '#019F62'); radgrad.addColorStop(1, 'rgba(1,159,98,0)'); ctx.scale(1,0.5); ctx.fillStyle = radgrad; ctx.fillRect(50,50,150,150);

Related questions

0 votes
    If the size of the array used to implement a circular queue is MAX_SIZE. How rear moves to traverse inorder ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Here are two files, foo.py and bar.py bar.py has... from foo import * ...at the top. ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 25, 2022 in Education by JackTerrance
0 votes
    One Indian and four American men and their wives are to be seated randomly around a circular table. Then, the conditional ... {1}{5}\) Select the correct answer from above options...
asked Nov 19, 2021 in Education by JackTerrance
0 votes
0 votes
    One Indian and four American men and their wives are to be seated randomly around a circular table. Then the conditional ... 5 D. 1 5 Select the correct answer from above options...
asked Nov 13, 2021 in Education by JackTerrance
0 votes
    Rectangular waveguides dominate the circular waveguides. Find the reason. (a) Low cut-off frequency ... by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    The circular waveguides use which function in the frequency calculation? (a) Laplace function (b) ... by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 5, 2021 in Education by JackTerrance
0 votes
    Does backpropagaion learning is based on gradient descent along error surface? (a) yes (b) no (c) cannot be ... descent but not error surface Please answer the above question....
asked Sep 3, 2022 in Education by JackTerrance
0 votes
    What is gradient descent? (a) method to find the absolute minimum of a function (b) method to find the absolute ... (d) none of the mentioned Please answer the above question....
asked Aug 30, 2022 in Education by JackTerrance
0 votes
    I am learning Machine Learning course from coursera from Andrews Ng. I have written a code for logistic ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    Sorry for what may sound simple, but I am trying to draw just a simple box in Visual Studio 2017 using the unicode ... code below #include using namespace std; int main() { cout...
asked Apr 21, 2022 in Education by JackTerrance
...