Creating a bitmap copy of a TextFlow object without the caret [cursor]

Hey all
I'm currently working on creating a bitmap copy of a TextFlow object and I am looking at hiding the caret. What would be the best way forward, using the focusmanager to 'unfocus' the TextFlow object, or is there some more direct approach available? I know there is a cursormanager in Flex, but this is an AS3 only project.
Cheers for your thoughts once again
emd

I think I've just done something similar to what you need (except I'm adjusting the width of the bitmap according to that of the text), and so far I have seen no cursor
Here's the code. You'll need to adjust it depending on how many containers (Sprites) you are drawing the TextFlow to.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               applicationComplete="init()">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Group id="groupText" width="560" />
    <fx:Script>
        <![CDATA[
            import flashx.textLayout.container.ContainerController;
            import flashx.textLayout.conversion.TextConverter;
            import flashx.textLayout.elements.TextFlow;
            import mx.core.UIComponent;
            private function init() : void
                var text : String = "Greek god gives mints.";
                var fontSize : int = 24;
                //We create a textflow with some text and set it's font size, just as an example.
                var flow : TextFlow = TextConverter.importToFlow(text, TextConverter.PLAIN_TEXT_FORMAT);
                flow.fontSize = 24;
                //We'll use a single container (and consecuently a single controller)
                var container : Sprite = new Sprite()
                var controller : ContainerController = new ContainerController(container);
                flow.flowComposer.addController(controller);
                //This is kind of weird, but I saw it in a TLF example, and it works.
                //It seems you have to "stretch" the container.
                controller.setCompositionSize(this.stage.stageWidth, this.stage.stageHeight);
                flow.flowComposer.compose();
                //Set the text's actual width and height as the composition size.
                controller.setCompositionSize(controller.getContentBounds().width,
                    controller.getContentBounds().height);
                //Redraw.
                flow.flowComposer.updateAllControllers();
                //As BitmapData's draw method takes an IBitmapDrawable,
                //we'll need to wrap the Sprite instance in an UIComponent.
                var tf : UIComponent = new UIComponent();
                tf.addChild(container);
                //Create an instance of BitmapData and "draw the container" into it.
                var bd : BitmapData = new BitmapData(controller.getContentBounds().width,
                    controller.getContentBounds().height + 2, true, 0x000000);
                bd.draw(tf);
                //Create a Bitmap with the text's data and add it to the application.
                var bmp : Bitmap = new Bitmap(bd);
                var ui : UIComponent = new UIComponent();
                ui.addChild(bmp);
                this.groupText.addElement(ui);           
        ]]>
    </fx:Script>
</s:Application>
Hope it helps,
Sebastián.

Similar Messages

  • Can I create a mirror image of a 3D object without flattening it?

    I'd like an exact copy of a 3D object I made to be looking back across my image at the other one. I feel retaining the 3D functionality of the second object enhances the authenticity of the image and keeps more options open if I decide I need to reposition them.
    I can change flatten a copy of the layer and do a Image rotation: flip canvas horizontal. No problem. But if I want the shadow it casts to play across the background differently than a flip of it's counterpart, then I'd need the new one to be a 3D object as well.
    Does anyone know how I might do this? I thought I might be able to find a transform panel for my first object, and that I could just enter the same values in reverse for my other object (they're not that complicated). But I don't see a tab for that. I'm new to PS 3D, so it's all kind of magic to me.
    Thank you!

    Yes, you can duplicate objects which have their own properties.

  • Copying formatting from conditional formatting without the rules

    I tend to use a lot of conditional formatting in my spreadsheets. Unfortunately, this leads to two problems:
         1) I need more rules than are allowed (this seems to be related to the height of my screen... probably because the dialog box doesn't have a scrollbar)
         2) This really, really slows things down, especially when combined with cell references, and particularly when I'm trying to rearrange cells (as far as I can see Numbers has a tendency to freeze and/or blank out the table I'm working on)
    The easiest way I can see out of my predicament would be to somehow remove the conditional formatting rules while keeping the actual formatting... like copy-and-pasting values instead of the actual cells (with intact formulae). Is this possible? And if possible, how would I go about doing it?
    Thanks in advance!

    Up to 15 rules can be set for conditional formating of a cell.
    1)
    Considering that the usual purpose of conditional formatting is to flag 'unusual' values, and to make the 'condition' instantly visible and recognizable, that seems an over generous number. If a cell or group of cells on your table 'needs' more than 15 possible formats (the base format and 15 others based on rules), perhaps what's needed is a re-thinking of why that many are needed, and whether having that many formats adequately answers that 'why'.
    If you really do need that many, you can set then, even if your display height is filled with fewer than that. Additional rules may be inserted after any existing rule, not just the last one. note, though, that the conditions are evaluated in the order the rules are listed, from top to bottom, and the format is set by the first rule encountered whose condition is met.
    2)
    Not surprising. Numbers recalculates the entire table each time a value in the table is changed. That calculation includes through each list of conditional formatting rules until a match is found (or the end of the list is reached), and includes setting the new format for each affected cell.
    3)
    Not that I'm aware of. The base format of the cell may be copied (option-command-C) and pasted elsewhere (option-command-V), and that pair of operations will include any conditional format rules that had been set for the original cell.
    But conditional formatting is just that—a set of rules that applies a set of attributes to a cell when a specific condition is met. The applied format exists only when the condition is met, and can't be copied except by copying the rule—actually the whole set of rules for that cell—which puts you no further ahead.
    3a) You could, of course, change the base format of the cell to match the colour and style applied by the conditional rule, then clear the conditional format rules for that cell or set of cells. That would 'remove the rules while keeping the (applied) formatting', and would leave the formulas intact. seems to me a game not worth the candle, though.
    Regards,
    Barry

  • Can I create a Class object without the VM?

    Using byte-code engineering, is it possible to create a class object?
    What about if I serialize a Class object to a file, can I byte-code engineer that and then reinstantiate it?

    Thanks I'll check it out. Basically I want to try it
    for fixing a problem of running two apps in the same
    VM.There's a world of problems when you try to run two programs within the same JVM. I wouldn't suggest even trying it unless it's a last resort. Why do you want to do that?

  • Hiding a Stage3D object without the viewPort

    The one useful thing about the old Stage3D.viewPort property was that you could hide the stage3D by setting the viewPort to null. Maybe a hack, but it had some uses when rendering to multiple targets.
    Has anyone found anything equivilent now that the viewPort is gone? My first thought is just to move the stage offscreen by setting x and y to large values. If someone has a better way, please share! Thanks.

    So, if I understand, the persistent classes represents a single row and there is no way to generate a code which is able to find several lines. If I want to have this kind of functions I must to implement them manualy with the method if_os_ca_persistency~get_persistent_by_query. I think than that is missing. I'm a fan of Ruby On Rails and I think than ActiveRecord will miss me.
    Thanks for your answer.

  • How to create a bitmap from a FlashPro Shape?

    CS Extension Builder n00b here.  I am looking for a way to generate a bitmap from a FlashPro Shape object.   The bitmap doesn't have to be a FlashPro Bitmap object... just an in-memory bitmap, or even a .png file on disc.  Any ideas on how to accomplish this?

    Hi,
    It's a two-step procedure:
    First, plot the data on your canvas, probably using CanvasDrawPoint (, , ); there are three NI examples for Canvas: use Help / Find Examples
    Second, you can save the canvas control to a file using SaveCtrlDisplayToFile from the toolbox library. As an alternative, you could use GetCtrlDisplayBitmap and then SaveBitmapToBMPFile.
    Wolfgang

  • Can I create a File object without writing it to the disk?

    I need construct a mechanism where I can "write" instructions to a file and then FTP this file to a remote system. It is basically a Telnet-like integration for a system that does not support Telnet. Once the file is on the remote device, it knows how to read the file and process its instructions.
    I would like to logically create this File object, by that I mean that I would like to use a FileWriter object to write the text instructions to the File, then use the Jakarta Commons NET API to FTP the file to the remote system. My question: can I create this File object without the file actually being written to the file system? Can the File just be memory resident for this creation and FTP?
    There could be tens of thousands of these transactions per day and I would like to just avoid any kind of deletion strategy, if I can. Thanks.

    Apart from the questionable decision to try and mess with the File object, I think the answer to (my guess at) your original question is "Yes".
    Jakarta Commons/Net FTP can upload to a server from any input stream you like. It doesn't have to be a FileInputStream. In particular it could be a ByteArrayInputStream, which reads from a byte array in memory.

  • Ora-23454 when add an objects to the materialized view group

    Hi, All,
    I tend to create a distributed MV, when add an objects to the materialized view group using:
    BEGIN
    DBMS_REPCAT.CREATE_MVIEW_REPOBJECT (
    gname => 'hr_repg',
    sname => 'hr',
    oname => 'departments_mv1',
    type => 'SNAPSHOT',
    min_communication => TRUE);
    END;
    I got the follwoing errors:
    ORA-23454: flavor not defined for object group "PUBLIC"."HR_REPG"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_REPCAT_UTL", line 452
    ORA-06512: at "SYS.DBMS_REPCAT_UTL", line 468
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 5599
    ORA-06512: at "SYS.DBMS_REPCAT_SNA", line 82
    ORA-06512: at "SYS.DBMS_REPCAT", line 1332
    ORA-06512: at line 2
    Does anybody know what is the problem?
    Thanks in advance for any advice.
    Sharon.Ni

    Are you trying to replicate an existing materialized view called "departments_mv1" ? That is what the implication of the arguments you are supplying.
    If it is an MV, you have to supply the DDL (in the DDL_TEXT) as well.
    Hemant K Chitale

  • Scaling objects without scaling corner effects

    When I scaled an object with Command-> and Command-< in CS3 (Mac), the corner effects would not be scaled. If I had 4mm round corners, they would still be 4 mm after scaling the object. In CS4 however, the corner effects are scaled too. Is there a simple way to scale an object WITHOUT the corner effects? I'm sure it's possible, but I can't find the answer...

    Thanks, but that only works when you click and drag to scale. I am talking about scaling with key's only: cmd-< and cmd->. I can't see an option or anything to use those keys and NOT scale corner effects. Okay, of course you could say 'Well, why don't you click and drag then!' but there is a specific document I have to work on every week that almost requires me to use the key commands for scaling.

  • With PS 7  create new  Place two objects on the new file  then you may cut copy and paste Cs2  create new  place two object on the new file Cut is not available how does one cut and paste in new file

    With PS 7
    create new
    Place two objects on the new file
    then you may cut copy and paste
    Cs2
    create new
    place two object on the new file
    Cut is not available how does one cut and paste in new file

    If your using File>Place then photoshop cs2 creates what's known as Smart Objects, which photoshop 7 didn't have.
    In photoshop cs2 you can rasterize the smart objects and that should make the Cut function available.
    Select both placed layers, right click on the area to the right of the tumbnail and select Rasterize Layers.
    If in photoshop cs2 you to Help>Photoshop Help and look under Layers>Smart Objects, that should give you a good overview of what smart objects are.

  • Is it possible to create a "virtual" copy of an object in illustrator?

    In other words, lets say that I've got an object (that might be a simple object like a square, or a complicated group, or anything).
    I can select the object, copy it and then paste it at some other location, but now it is a separate object.
    What I'd like to do is make a "virtual" copy of the object, so that if any modifications are done to one of the copies, they are also done to the other copy. I.e., if I change the color of one sub-object in one of the virtual copies, the color also changes in the corresponding sub-object of the other virtual copy.
    Note that this is similar to lightrooms virtual copy feature of images, but in that case, the modifications are separate even though the underlying image stayes the same. What I'm asking about here is for the ability to "link" objects together.
    BTW, the basic reason I want this is for the following reason: I want to have an object occur in more than one artboard, but if I modify the object in one artboard, I'd like it to also be modified in the second artboard. It is not feasible to have the artboards overlap over *just* the object that I need (as that would in some sense solve the problem, and in fact does solve the problem in some limited circumstances, but not all of them, namely those where the two arboards need to have other also objects along with the common object that do not overlap).
    thanks!

    Just an addition, jb (unless this has changed in the latest version(s)):
    If you want the option to position/align them by anything but the centre of the appearance (including effetcs), you may add a nostroke/nofill rectange/circle centred over the centre of the artwork and extending past its appearance in all directions.

  • How can you copy properities from one object to another?

    If you create a number of boxes and then decided to change the color of all of them (or add a stroke, shadow, etc), is there a way to copy your style from one to the others?  In Photoshop you can copy layer styles, so you don't have to re-do everything for every layer you want the styles to be on.  How is this done in InDesign (CS3)?
    Thanks.

    From the object styles panel. Click on the object, define style (new object style), click on the next object, apply that new style. Even quicker than copy/paste. Then, if you make a change to the style, all objects are updated. Just want to do one?  Alter the object itself (and create a new style while you're at it ).

  • Creating a deep copy

    I wrote a stack implementation using a LinkedList, I have null constructor to create the first stack and it works fine but now i have to create a copy for a second stack using the element of the first constructor
    this my code
    import java.util.LinkedList;
    public class Stack<T>{
      private LinkedList<T> stack;
      public Stack(){
        stack =  new LinkedList<T>();
      public Stack(Stack<T> s) {// the problem is here it compile but when i run
                                                     // the program the second stack raised an exception because is empty
                                                     // i want to create a deep copy with the elements of the first stack
         stack = new LinkedList<T>();
      public boolean isEmpty(){
      return stack.isEmpty();
      public void push(T item){
       /*method to add object information
        *pre the object is not full
        * pos: the object is inserted
          stack.addFirst(item);
      public T top() throws EmptyStackException{
        if (!stack.isEmpty()){ 
          return stack.getFirst();
        else{
          throw new EmptyStackException("StackException on top " + " Stack empty");
      public T pop() throws EmptyStackException{
        /*method to remove an element of the stack
        *pre the object is not empty
        * pos: the object is remove
        * response throws an exception
        if (!stack.isEmpty()){ 
          return stack.removeFirst();
        else{
          throw new EmptyStackException("StackException on top" + "stack empty");
    public int numElements(){
        return stack.size();
    public void clear(){
      stack.clear();
    public class EmptyStackException extends Exception{
            public EmptyStackException( String message){
              super(message);
    }

    wel well... are you doing this on a mobile phone???
    neways to get to ur question u can use the clone() method to generate a clone of your object which is the same as a deep copy for eg:
    public class CloneTest{
        CloneTest test1 = new CloneTest();
        CloneTest test2;
        CloneTest(){
          //Some initialization code;
        CloneTest(CloneTest temp){
             test2 = test1.clone();
    }clone is a method of the object class.

  • Is it possible to copy a Cross-Tab object and Formulars to a new report.

    Afteroon all,
    I have created a Balance Sheet report using quite a few formulars and items. They are listed in a cross-tab object. Everything is working fine except something has happened to the report at some stage and it is causing problems when I deploy my web app (the rpt file will not delete when I undeploy my web app, it gets locked, untill I shutdown tomcat)
    So I want to try create a new rpt file and copy the cross-tab object and all its formulars across.
    So is there a way to copy formulars from one report to another and also is it possible to copy a cross-tab object across.
    Thanks
    Darren
    (PS Unless someone can tell me why my rpt file is being locked by tomcat)

    I am running windows and the rpt file "locks" and I have just noticed the \WEB-INF\lib\derby.jar file also locks. I dont use the derby.jar file at all. (as far as I am aware - I got an oracle connection).
    Maybe I am redeploying incorrectly or not clearing the report correctly.
    What I do is, I copy the WAR file to the webapps folder, Tomcat unpacks the app and I can run my reports no problem, fresh data is displayed if different parameters are used. I then close my browser window and make changes to my report design. I delete the WAR file in the webapps folder and export my project to a war file again - to the webapps, Tomcat then tries to clear the old project folder so that it can deploy the new WAR. it clears out everything except the rpt file and the derby.jar files. And then of course cannot redeploy the WAR file. So I have to stop tomcat and delete the project myself and start Tomcat again.
    Clearly this is not good as I dont want to have to stop and start my Tomcat server everytime I make changes.
    So how should I correctly undeploy a current version of my webapp and then deploy the new changes. Or am I not doing something when I am finished viewing the report.
    Sorry for going off Thread topic.
    I have tried using copies of the report but the same still happens.
    Thanks
    Darren
    Im busy reading the "CR not releasing the memory " thread, hopefully the answer is in there somewhere
    Edited by: Darren Jackson on Oct 7, 2008 5:21 PM

  • Copy constructor and temporary objects in C++

    I'd need some clarification on how constructor works when the argument is  a temporary object. I defined a dummy MyVect class with operator+ and copy constructor:
    class MyVect {
    public:
    MyVect() {
    cout << "Constructor" << endl;
    MyVect(const MyVect &vect){
    cout << "Copy Constructor" << endl;
    ~MyVect() {
    cout << "Destructor" << endl;
    MyVect operator+(const MyVect &v) const {
    cout << "operator+" << endl;
    MyVect result
    return result;
    Then I test it with this very simple code pattern:
    MyVect v1;
    MyVect v2;
    MyVect v3(v1 + v2);
    The output is:
    Constructor
    Constructor
    operator+
    Constructor
    Destructor
    Destructor
    Destructor
    The first two constructor calls are for v1 and v2, then operator+ for  v1+v2 is called, and  inside it there is a constructor call for result object. But then no copy constructor (nor constructor) for v3 is called. In my limited understanding of C++, I guessed that once the temporary object resulting from v1+v2 has been created, then it would be the argument of the copy constructor call. Instead it looks like the compiler transforms the temporary into v3, since v3 is correctly initialized as the sum of v1 and v2 (I tried with a more complicated version of MyVect to verify this). This behavior reminds me of the move semantics introduced with C++11, but I'm not using the -std=c++11 flag (and in fact if I try to define a move constructor the compilation fails).
    Can anyone please help me to understand what's happening under the hood? Thanks.
    Last edited by snack (2013-02-13 10:44:28)

    wikipedia wrote:The following cases may result in a call to a copy constructor:
    When an object is returned by value
    When an object is passed (to a function) by value as an argument
    When an object is thrown
    When an object is caught
    When an object is placed in a brace-enclosed initializer list
    These cases are collectively called copy-initialization and are equivalent to:[2] T x = a;
    It is however, not guaranteed that a copy constructor will be called in these cases, because the C++ Standard allows the compiler to optimize the copy away in certain cases, one example being the return value optimization (sometimes referred to as RVO).
    Last edited by Lord Bo (2013-02-13 13:58:47)

Maybe you are looking for

  • Can't adjust clip duration of still photos in iMovie '11

    Anyone having the same problem? I inserted a still photo in one of my projects in iMovie which has a a clip duration of 5s when added. I clicked the cogwheel icon then chose the inspector to adjust the duration. I've managed to changed it to 3s but a

  • Transferring OS from HDD to SSD using ThinkVantage Tools?

    Hi everyone. I recently purchased a ThinkPad T420 from Lenovo and an mSata SSD (80gb) off Newegg. I installed the drive properly and my computer recognizes the drive, etc. Now, when I bought my ThinkPad, I didn't purchase a physical copy of Windows 7

  • Operating System?

    I just was given a I Book G3 - So, I have booted it up and checked it all out and then reached a point to where I need information. For some reason I can't tell what the operating system is. Even on my G4 PPC I couldn't tell you if I have Leopard, Ti

  • What to do if my iphone says "account not on this store" in updating apps on the app store

    what to do if my iphone says "account not on this store" in updating apps on the app store

  • Macbook Pro crashes everytime it wakes up from Sleep

    Hi all. I am experiencing a problem of crashes everytime I try to wake up the computer from sleep my Macbook Pro 2010, be it a long sleep or a short sleep. I did not have any problems at all on Mac OS X Lion and a week ago, I upgraded to Mountain Lio