Skip navigation
Home/Support/

Forums

438 Views 8 Replies Latest reply: Nov 13, 2009 11:03 PM by Flex harUI RSS
JohnBailey-NovelaStudios Calculating status... 6 posts since
Nov 10, 2009
Currently Being Moderated

Nov 10, 2009 12:35 PM

Rasterize a Transformed Vector without Pixelation

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

  • Flex harUI Adobe Employee 6,800 posts since
    May 18, 2006

    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

  • Flex harUI Adobe Employee 6,800 posts since
    May 18, 2006

    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

  • Flex harUI Adobe Employee 6,800 posts since
    May 18, 2006

    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

  • Flex harUI Adobe Employee 6,800 posts since
    May 18, 2006

    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

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

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