API to bitmap
- Creepy
-
Creepy
- Member since: Nov. 28, 2004
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
I made a drawing program in flash and was wondering if there is a code that export the api code the user make into a .jpg!
- caseyo
-
caseyo
- Member since: May. 14, 2005
- Offline.
-
- Forum Stats
- Member
- Level 23
- Blank Slate
- Sam
-
Sam
- Member since: Oct. 1, 2005
- Offline.
-
- Forum Stats
- Moderator
- Level 19
- Programmer
Paste the API code, press Control + Enter and take a screenshot =P
- Creepy
-
Creepy
- Member since: Nov. 28, 2004
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
ok here's the code and a screenshot.
The last part in the code make all the API coding into a Bitmap (by Glailel Gamer),
but i still need to know how to export the bitmap!
code:
createEmptyMovieClip("myDrawing", 1);
myDrawing.lineStyle(2, 0x000000, 100);
onMouseDown = function () {
myDrawing.moveTo(_root.pencil._x, _root.pencil._y);
onMouseMove = function () {
myDrawing.lineTo(_xmouse, _ymouse);
};
};
onMouseUp = function () {
onMouseMove = null;
};
onEnterFrame = function () {
Mouse.hide();
if (_ymouse>70) {
_root.pencil._x = _root._xmouse;
_root.pencil._y = _root._ymouse;
_root.mouse._x = 1000;
} else {
_root.mouse._x = _root._xmouse;
_root.mouse._y = _root._ymouse;
_root.pencil._x = 1000;
}
_root.pencil.swapDepths(10);
_root.wall.swapDepths(2);
_root.mouse.swapDepths(11);
_root.boldpanel.swapDepths(5);
_root.colorpanel.swapDepths(6);
};
import flash.display.BitmapData;
var myBitmapData:BitmapData = new BitmapData(550, 400, false, 0x00FFFFFF);
myBitmapData.draw(_root);
_root.bitma.attachBitmap(_root.myBitmapDat
a)
- Creepy
-
Creepy
- Member since: Nov. 28, 2004
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
so no one who got anything to say?
no comments, nothing?
- Newsdee
-
Newsdee
- Member since: Jan. 21, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
The problem to export the bitmap is getting that data out of Flash into a file. I don't think the Flash player can save a file to disk other than the "SytemObjects"... so your only solution would be to plug your flash app to a PHP server that gets the bitmap data and saves it as JPG... but that's kind of a lot to do :-)
- Newsdee
-
Newsdee
- Member since: Jan. 21, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
Just found this: how to export an image with Flash/PHP .

