Topic: Flash 8: Playing with pixels Pages that link to <a href="https://ozoneasylum.com/backlink?for=27653" title="Pages that link to Topic: Flash 8: Playing with pixels" rel="nofollow" >Topic: Flash 8: Playing with pixels\

 
Author Thread
zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 03-17-2006 21:57 Edit Quote

I wanted to build a simple Flash app that used pixels, so here it is:

First version (built during a business meeting):
http://zavaboy.com/fla/draw01.html (100%)
http://zavaboy.com/fla/draw01.swf (scalable)

Second version:
http://zavaboy.com/fla/draw02.html (100%)
http://zavaboy.com/fla/draw02.swf (scalable)

Make sure you have the latest Flash player.
I'd like any C&C.

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

IP logged posted posted 03-18-2006 07:08 Edit Quote

Looks pixelly. Also looks to be a clean piece of work... although an eraser tool would be nice.


Justice 4 Pat Richard

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 03-18-2006 10:40 Edit Quote

So far so good.
May I make some feature requests too

- several brushes
- displaying the borders of the current brush
- show/hide pixels grid
- export/save capability ( like in .ICO or at worst .BMP )

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 03-18-2006 11:05 Edit Quote

So far so good.
May I make some feature requests too

- several brushes
- displaying the borders of the current brush
- show/hide pixels grid
- export/save capability ( like in .ICO or at worst .BMP )

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

IP logged posted posted 03-18-2006 15:40 Edit Quote

That's a fun project!

This from Grant Skinner might be useful for poi's save capability suggestion:
http://www.gskinner.com/blog/archives/2006/03/saving_bitmapda.html
Maybe?

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 03-18-2006 17:18 Edit Quote

Steve: thank you. I had forgotten about gskinner.com.
Sidenote : damn I HATE websites using Flash for navigation. The usability utterly suck. No middle click, no right click, nothing. Raaaaah. Hopefully gskinner.com has some interresting apps.

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

IP logged posted posted 03-18-2006 20:07 Edit Quote

fun stuff here:
http://incomplet.gskinner.com/

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 03-18-2006 20:15 Edit Quote

So how do I get it to export? I'm lost on this one.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

IP logged posted posted 03-22-2006 13:41 Edit Quote

exporting might get a bit complicated, since you cant directly write to a file afaik.

what you can do is communicate with a server-side script to which you can send your pixels in a custom format. the script could then either write an image to a file on the server or send it to the user.

tell me if you are interested in this and need more information.

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 03-23-2006 01:19 Edit Quote

I sort of had that much of the idea. Is there an efficient way to do it without screwing too much with my head? I do want more information on this.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

IP logged posted posted 03-26-2006 11:37 Edit Quote

ok, i assume you already have some custom format in your flash movie where the pixels are stored. probably a two dimensional array with color values.

i suggest you create a php script, in which the gd library php->gd creates the image and with php->imagesetpixel you can set each pixel.

to get the pixeldata to the php file, you can just create one huge string and post them to the php-script using flash.
look up "loadVariables" in the flash help on how to post variables via HTTP.

for example if the image would be 400 by 300 and all red, the string could look like:

400|300|ff0000|ff0000|ff0000|.....

your php script can then php->explode this string and you will get an array where the first two values are width and height followed by the pixel colors in hex format.

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 03-30-2006 03:08 Edit Quote

I can't seem to get the colors of all the pixels...

I'm running off this as an example:
http://broadcast.artificialcolors.com/index.php?title=setpixel_getpixel_and_the_flash_8_beta_b

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 03-31-2006 02:47 Edit Quote

I have it figured out... but I can't get it to export to the PHP script... let me figure this out by myself, please!

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 03-31-2006 10:55 Edit Quote

... on the other hand you could give CANVAS and the 'Opera-2dgame' Canvas Context a go

You could easily manipulate the pixels, and export the whole thing as a PNG image using the toDataURL() method.

The 'Opera-2dgame' Canvas Context is a part of our embrace and extend the standards idea. I hope we'll submit a proposal to the WHATWG soon.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu