Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Whiteboard with images

Avatar

Former Community Member
Hi

I discover cocomo, very nice



how can i integer the possibilité to lunch a picture in
the whiteboard ? (jpg or gif)

and the possibility to reduce the size of the pictures ?



thanks for your help
13 Replies

Avatar

Former Community Member
Hi,



As a generic case, you can add UIComponents( like an image)
to the whiteboard but it will require some hacking of code. You
should have a look at the way the WBShapesToolbar interfaces with
WBShapeFactories and the WBCanvas (these are all in the
coreUI/controls dir). This is a request we have received earlier
and we will seriously give a thought to incorporate adding imge
functionality for future.

Thanks

Hironmay Basu

Avatar

Former Community Member
Thanks for your reply.



anybody have some exemple of code or something for beginer
?

Avatar

Level 2
Believe it or not shape framework looks to be pretty well
suited for expanding it for just this sort of thing. It took me a
while to wrap my head around exactly how this works but I think I
have pretty good grasp of it now.



There are 3 things you need to do to add an ImageShape to the
whiteboard...



1) Write an ImageShape Class - this is where you put the code
on how your image displays, which image to use, etc. Initially just
try to imbed an image and don't worry about trying to get dynamic
images (using Loader, Image or SWFLoader) to work.



2) Write an ImageShapeFactory Class - this what will spawn
the ImageShape Instance. Pay special attention to setting
"definitionData" and "propertyData". Start with
WBSimpleShapeFactory and trim it up for your usage to make your
ImageShapeFactory Class.

- definitionData is the data associated with the shape type
for instance if you look at WBSimpleShape you see that
definitionData is simply a string which determines if the shape is
an ellipse, rectangle, or roundedRectangle.

- propertyData deals with the properties of the object,
things like stroke thickness, stroke color, fill color, etc.
propertyData is pulled from a WBPropertiesToolBar or really any
toolbar that implements IWBPropertiesToolBar.



3) Once you have and ImageShapeFactory and an ImageShape
Class, you now need to add an extra Icon to the WBShapesToolBar to
spawn your new ImageShape when the user clicks on it. Initially
just modify WBShapesToolBar.as directly. Ideally you would want to
extend this Class but that can get a bit complicated so for now
just modify the source directly. Around line 177: duplicate the
following line:



{type:"tool", toolTip:_lm.getString("Line Tool"),
icon:ICON_LINE, shapeFactory:arrowFactory,
shapeData:WBArrowShapeFactory.NO_ARROW_HEAD},



and change one of the copies to:

{type:"tool", toolTip:"Image Shape", icon:ICON_LINE,
shapeFactory:imageFactory, shapeData:""},



at the top around line 117 :

protected var arrowFactory:WBArrowShapeFactory = new
WBArrowShapeFactory();

add the following line:

protected var imageFactory:ImageShapeFactory = new
ImageShapeFactory();



Assuming you built ImageFactory and ImageShape right an
ImageShape should be spawned when you click one of the now two line
icons.



I modified my source to hell and gone in an effort to do
"research" or else I would post the version of ImageShape and
ImageShapeFactory that I have. I might make some modifications to
those and post them just so everyone can see an example. I'll post
another reply with the code if I do. I really hope that helped a
little (at least pointed you in the right direction)....



Ves









Avatar

Former Community Member
thanks Ves for your reply



It's a little difficult for me

can you send me a complet code ?



startx252000 AT yahoo Fr



thanks

Avatar

Former Community Member
HI Ves



i apreciate if you can send me a complet code of this class ?



startx252000 AT yahoo.fr



thanks

Avatar

Level 2
You might also want to take a look at the Degrafa framework.
It has some very rich capabilities for declarative graphics that
could be a nice foundation for an extended whiteboard (and one that
could theoretically be easily serializable, in its native MXML
form).

Avatar

Former Community Member
Just started to dive into the AFCS stuff and the first thing
I also thought of was the colab opportunity of having, say, a video
presentation where the presenter could draw on a graphic to
illustrate their point.



I am more familiar with AS then Flex, so I'm glad to see that
there's the various AS backend running the whiteboard.



Going off of what Hironmay had mentioned I looked at the
three AS UI pages.



So if I follow, then I need to set up a function in
IWBShapeFactory.as which gets called by a button / action in
WBShapesToolBar.as and WBCanvas.as would have the actual image
shape loader function.



I think :D

Avatar

Former Community Member
Hi Bit Crusher



I am too newbie for this,...

Do you have some example to help me ?



Avatar

Former Community Member
I might once I get started :) I have a general idea on what
to do, now it's a matter of getting the proper code sequence
without breaking everything.

Avatar

Former Community Member
Hi

Thanks to your reply



you are looking also for a video presentation....



I will just a whiteboard with jpg basic editor

I hope you can help me soon

Avatar

Level 2

Hi Ves,

what if you wanted to create your own custom tool bar? Such as a photo gallery.

Would you say this is possible?

Thanks.

Avatar

Employee

Hi James,

Creating a custom tool bar is possible. Check out WhiteBoardCustomShapes in the SDK's sampleApps. You can also try out the app at http://blogs.adobe.com/arunpon/swfs/WBTriangle.swf

There are options to customize or build a new toolbar.

Thanks

Arun