dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Blurred image

  1. #1
    Member
    Join Date
    Jun 2005
    Posts
    38

    Blurred image

    Hi,

    Problem is when I want to crop image using actionscript.
    It's ok, until I am not using angled rectangle...
    Code:
    var angle:Number = 35;
    var crop_rect:Rectangle = new Rectangle(0,0,200,150);            
    var crop_point:Point = new Point(100,60);                     
    var crop_angle:Number = angle * Math.PI / 180;
    
    var dA:Number = Math.atan(crop_point.y / crop_point.x) - crop_angle;
    var tX:Number = crop_point.length * Math.cos(dA);
    var tY:Number = crop_point.length * Math.sin(dA);
    
    var scaleMatrix:Matrix = new Matrix(Math.cos( -  crop_angle),Math.sin( -  crop_angle), -  Math.sin( -  crop_angle),Math.cos( -  crop_angle), -  tX, -  tY);
    
    var result_bitmap = new BitmapData(crop_rect.width,crop_rect.height, false, 0xFFFFFFFF);
    result_bitmap.draw(source_img, scaleMatrix , null, null, crop_rect, true);
    var result_img:Bitmap = new Bitmap(result_bitmap, "auto", true);
    result_img.x=470;
    result_img.y=10;
    result_img.rotation = angle;    
    addChild(result_img);
    Source

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    This may just be a result of rotating pixels. Once they've been rotated, they are interpolated to retain as much clarity as possible. Rotating them back is not going to remove the aliasing. Perhaps rotating a mask shape and using that will prevent any initial rotation.

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