Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/06/2009, 19:26
Avatar de dmassive
dmassive
 
Fecha de Ingreso: febrero-2002
Ubicación: Paraná - Entre Ríos - Argentina
Mensajes: 279
Antigüedad: 22 años, 2 meses
Puntos: 7
Respuesta: Cómo mostrar un pixel por pantalla?

La manera mas facil que conozco es usando pygame:
http://www.pygame.org/

Y mas concretamente (uh, te la hice refacil) :) aca tenes el source code:
http://lorenzod8n.wordpress.com/2007...rial-5-pixels/

Posteo el codigo por si el blog desaparece (cut & paste):

Código python:
Ver original
  1. 1 #! /usr/bin/env python
  2.  2
  3.  3 # Plot random pixels on the screen.
  4.  4
  5.  5 import pygame
  6.  6 import random
  7.  7
  8.  8 # Window dimensions
  9.  9 width = 640
  10. 10 height = 400
  11. 11
  12. 12 screen = pygame.display.set_mode((width, height))
  13. 13 clock = pygame.time.Clock()
  14. 14 running = True
  15. 15
  16. 16 while running:
  17. 17     x = random.randint(0, width-1)
  18. 18     y = random.randint(0, height-1)
  19. 19     red = random.randint(0, 255)
  20. 20     green = random.randint(0, 255)
  21. 21     blue = random.randint(0, 255)
  22. 22
  23. 23     screen.set_at((x, y), (red, green, blue))
  24. 24
  25. 25     for event in pygame.event.get():
  26. 26         if event.type == pygame.QUIT:
  27. 27             running = False
  28. 28
  29. 29     pygame.display.flip()
  30. 30     clock.tick(240)
__________________
Blümchen... einfach die rave Prinzessin
http://www.dmassive.com.ar/