Файл:Processing-sketch jun11a.png

Съдържанието на страницата не се поддържа на други езици.
от Уикипедия, свободната енциклопедия

Оригинален файл(956 × 625 пиксела, големина на файла: 71 КБ, MIME-тип: image/png)

Емблемата на Общомедия Този файл е от Общомедия и може да се използва от други проекти.

Следва информация за файла, достъпна през оригиналната му описателна страница.

Резюме

Описание
English: Screenshot of a Processing-1.5.1 sketch output, created by the example script in Wikipedia.
Дата
Източник Собствена творба
Автор Joosep-Georg

Processing src code

PShape usa;
PShape state;
String [] Obama  = { "HI", "RI", "CT", "MA", "ME", "NH", "VT", "NY", "NJ",
	 "FL", "NC", "OH", "IN", "IA", "CO", "NV", "PA", "DE", "MD", "MI",
	 "WA", "CA", "OR", "IL", "MN", "WI", "DC", "NM", "VA" };

String [] McCain = { "AK", "GA", "AL", "TN", "WV", "KY", "SC", "WY", "MT",
	 "ID", "TX", "AZ", "UT", "ND", "SD", "NE", "MS", "MO", "AR", "OK",
	 "KS", "LA" };

void setup() {
  size(950, 600);
  // The file Blank_US_Map.svg can be found at Wikimedia Commons
  usa = loadShape("http://upload.wikimedia.org/wikipedia/commons/3/32/Blank_US_Map.svg");
  smooth(); // Improves the drawing quality of the SVG
  noLoop();
}

void draw() {
  background(255);
  // Draw the full map
  shape(usa, 0, 0);
  // Blue denotes states won by Obama
  statesColoring(Obama , color(0, 0, 255));
  // Red  denotes states won by McCain
  statesColoring(McCain, color(255, 0, 0));
  // Save the map as image
  saveFrame("map output.png");
}

void statesColoring(String[] states, int c){
  for (int i = 0; i < states.length; ++i) {
    PShape state = usa.getChild(states[i]);
    // Disable the colors found in the SVG file
    state.disableStyle();
    // Set our own coloring
    fill(c);
    noStroke();
    // Draw a single state
    shape(state, 0, 0);
  }
}

Лицензиране

Аз, носителят на авторските права над тази творба, я публикувам тук под следния лиценз:
Creative Commons CC-Zero Този файл е достъпен под лиценза Creative Commons CC0 1.0 Универсален Посвещение на публичните домейни.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Описания

Add a one-line explanation of what this file represents

Items portrayed in this file

изобразен обект

Някаква стойност без обект в Уикиданни

source of file английски

original creation by uploader английски

История на файла

Избирането на дата/час ще покаже как е изглеждал файлът към онзи момент.

Дата/ЧасМиникартинкаРазмерПотребителКоментар
текуща11:34, 11 юни 2011Миникартинка на версията към 11:34, 11 юни 2011956 × 625 (71 КБ)Joosep-Georg

Следната страница използва следния файл:

Глобално използване на файл

Този файл се използва от следните други уикита: