我正在尝试制作一个100x100图像,每个像素都是不同的随机颜色,如下例所示:

我试过用,matplotlib但我运气不好.我应该使用PIL吗?
所以被推到这个数组的依赖于几个无线电盒.我有这个标准和轮椅座位:
if(document.getElementById('standardseat').checked) {
//Standard seat is checked
seatsArray.push(e.posX, e.posY);
}
else if(document.getElementById('wheelchairseat').checked) {
//Wheelchair seat is checked
seatsArray.push("Wheelchair " + e.posX, e.posY);
}
Run Code Online (Sandbox Code Playgroud)
这是等效的表单代码:
<input id="standardseat" type="radio" name="seat" value="standard" /> Standard seat
<input id="wheelchairseat" type="radio" name="seat" value="wheelchair" /> Wheelchair seat
Run Code Online (Sandbox Code Playgroud)
但我想增加一些与标准/轮椅座位分开的收音机盒:
<input id="backnave" type="radio" name="area" value="backnave" /> Back Nave
<input id="frontnave" type="radio" name="area" value="frontnave" /> Front nave
<input id="middlenave" type="radio" name="area" value="middlenave" /> Middle nave
Run Code Online (Sandbox Code Playgroud)
我希望推动也包括这一点.为了解释,如果用户勾选"轮椅座位"和"中间中殿",则应输出推送("MN,Wheelchair"+ e.posX,e.posY).有没有办法让这种情况发生而不用手动包括很多其他如果每个可能的结果(我甚至可能想添加第三组无线电盒)?
谢谢!
将表单提交到savetext.aspx操作文件时出现此错误:
Compiler Error Message: CS0120: An object reference is required for the nonstatic field, method, or property 'System.Web.UI.Page.Request.get'
Run Code Online (Sandbox Code Playgroud)
在这一行:
string path = "/txtfiles/" + Request.Form["file_name"];
Run Code Online (Sandbox Code Playgroud)
整码:
<%@ Page Language="C#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">
class Test
{
public static void Main()
{
string path = "/txtfiles/" + Request.Form["file_name"];
if (!File.Exists(path))
{
using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine(request.form["seatsArray"]);
sw.WriteLine("");
}
}
using (StreamReader sr = File.OpenText(path))
{
string s = "";
while ((s = …Run Code Online (Sandbox Code Playgroud) arrays ×1
asp.net ×1
c# ×1
draw ×1
if-statement ×1
image ×1
javascript ×1
matplotlib ×1
push ×1
python ×1
radio-button ×1