Skip navigation
JohnBailey-NovelaStudios
Currently Being Moderated

Rasterize a Transformed Vector without Pixelation

Nov 10, 2009 12:35 PM

How does one rasterize a transformed vector capturing it's new dimensions without pixelation?


Challenge: To render a bitmap of a transformed vector display object without pixelation. Specifically, after a mx.controls.Text is transformed, a bitmap snapshot is needed to be taken of the new object including the dimensions.  I should note that the reason I am needing to get a bitmap snapshot is do to some shaping to the text.


Problem: However, doing so results in pixelation or the original dimensions of the transformed Text. It appears that flash.display.BitmapData::draw cannot get the new transformed display.


Example: http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAndD imensions.html#
When the application creation complete is fired a snapshot is made. Change the matrix width (transform.matrix.a) and then re-render a snapshot / bitmap. Notice it retains the original, non-transformed values. Therefore and considering it is a rastered snapshot, when the snapshot/bitmap is scaled it becomes pixelated. Example version is now 1.1.0.0

 

 

Also at http://flashmoment.blogspot.com/2009/11/rasterize-transformed-vector-w ithout.html

  • Currently Being Moderated
    Adobe Employee
    Nov 10, 2009 1:03 PM

    Not quite sure what you're asking, but transform.pixelBounds should show the bounds of most transformed objects unless they are clipping.

     

    Once you make a bitmap, scaling is likely to pixelate.

     

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc.

    Blog: http://blogs.adobe.com/aharui

    |
    Mark as:
  • Currently Being Moderated
    Adobe Employee
    Nov 10, 2009 3:31 PM

    You might have to wrap the scaled object in a parent and take a snapshot of the parent.

     

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc.

    Blog: http://blogs.adobe.com/aharui

    |
    Mark as:
  • Currently Being Moderated
    Adobe Employee
    Nov 10, 2009 10:09 PM

    No.  I think of the transform like a magnifying glass applied to the object.  The object doesn't know it has been transformed, but the parent, who is looking through the magnifying glass, does and sees the transformed result so that's what you need to capture.

     

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc.

    Blog: http://blogs.adobe.com/aharui

    |
    Mark as:
  • Currently Being Moderated
    Adobe Employee
    Nov 13, 2009 11:03 PM

    Almost nothing in the Flash Player dispatches events when changed.  It makes watching for changes very difficult.  The Flex Framework has taken the time to get the 80% cases to dispatch events, but there is a performance cost to doing so and it isn't always possible to trap changes.  Rotation and Scale is better handled in Flex 4 (although the Spark components can be a bit slower because of it).

     

    Some properties are immediately modified by transform changes and vice-versa (scaleX/Y is reflected in the transform and vice-versa).  But if a object positioned a rectangle at 50,50 to 100, 100, then got scaled, the xy of that child rectangle is still 50,50 and I think that is correct.  That's why I think of scale as a magnifying glass above object.

     

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc.

    Blog: http://blogs.adobe.com/aharui

    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points