-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdraw_blankstimulus.js
More file actions
30 lines (20 loc) · 843 Bytes
/
Copy pathdraw_blankstimulus.js
File metadata and controls
30 lines (20 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//Function to draw blankstimulus
export function draw_blankstimulus(canvasID)
{
var stimCanvas = document.getElementById(canvasID);
var stimContext = stimCanvas.getContext("2d");
//create black stimulus box
var squareWidth = 250;
var sqystartpoint= (stimCanvas.height - squareWidth)/2;
var sqxstartpoint= (stimCanvas.width - squareWidth)/2;
function createbox() {
stimContext.fillStyle = "#000000 "; // grey inner square#C0C0C0
stimContext.fillRect(sqxstartpoint, sqystartpoint, squareWidth, squareWidth);// Fill black square (stimulus background)
}
createbox();
//specification
var cellSize = 10;
var string4stimulus = stimCanvas.toDataURL();
stimContext.clearRect(0, 0, stimCanvas.width, stimCanvas.height);
return string4stimulus;
}