A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [RESOLVED] Better Bitmap draw method or render class, need help

  1. #1

    resolved [RESOLVED] Better Bitmap draw method or render class, need help

    Hi,

    I was wondering if anyone knows of any custom classes created by the community that can render vector graphics onto bitmapData objects better than the current flash vector renderer. The current draw method I have been using is either too pixelated with smooth set to false or too blury with it set to true after the render to a bitmapData.

    Is there some class out there that has more options than the draw method, or some way to render a vector to a bitmapData object without much distortion?


    I would greatly appreciate any help .

    Thanks,

    TariqM

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    ImageProcessing includes its own drawing api, but I don't think this will help if you're trying to draw existing assets rather than use the graphics class to draw stuff.

    http://je2050.joa-ebert.com/imageprocessing/

  3. #3
    Looks like that just renders an already created bitmapData object. Interesting link though, but I'm looking for something that turns a vector into a bitmapData object without too much distortion.

    Thanks for the link though, will definitely bookmark these classes.

  4. #4
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    bitmapData.draw uses exactly what the flash rendering engine outputs - if you're getting distortion, it's because your bitmap is either rotated, scaled, or positioned to a sub-pixel.

    If you need to have zoomability (or whatever), try wrapping your vector drawing, scaling it up, and .draw()ing the wrapper and then scaling both back down. That would give you more pixel data to work with.

  5. #5
    I'll try that out,

    Thanks neznein9

  6. #6
    It works neznein9. Instead of using the draw methods matrix parameter I just scaled the vector graphic before drawing it to a bitmapData. So no need for a better render method...

    The one thing I do not understand though is why I had to scale my vector, add it to a displayObject then finally draw that displayObject to the bitmapData in order to achieve the new scale.

    If I tried just scaling a displayObject then drawing it the vector kept to it's original aspect.

    If anyone can answer that I'd appreciate it.

    Thanks,

    TariqM

  7. #7
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Quote Originally Posted by ActionScript 3.0 Language and Components Reference
    This method directly corresponds to how objects are drawn with the standard vector renderer for objects in the authoring tool interface.

    The source display object does not use any of its applied transformations for this call. It is treated as it exists in the library or file, with no matrix transform, no color transform, and no blend mode.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center