# Wtf, trying to resize bitmap.. not working?

**URL:** <https://forum.kirupa.com/t/wtf-trying-to-resize-bitmap-not-working/305279>\
**Category:** flash\
**Created:** [February 22, 2010, 6:42pm UTC](https://forum.kirupa.com/t/wtf-trying-to-resize-bitmap-not-working/305279 "2010-02-22T18:42:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cry4dawn](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cry4dawn](https://forum.kirupa.com/u/cry4dawn)\
**Post date:** [February 22, 2010, 6:42pm UTC](https://forum.kirupa.com/t/wtf-trying-to-resize-bitmap-not-working/305279/1 "2010-02-22T18:42:09Z")

</div>

Hey everyone. I have been having issues with a program and realized the thumbnails I thought I was creating were actually full sized. Whats wrong with this code? Thanks.

```auto

import com.adobe.images.JPGEncoder;
var m:MovieClip = mcTest;

var jpgSource:BitmapData = new BitmapData (m.width, m.height, false, 0xFFFFFF);
jpgSource.draw(m);
    
var bitmapToScale:Bitmap = new Bitmap(jpgSource);
bitmapToScale.smoothing=true;
    
bitmapToScale.width = 100;
bitmapToScale.scaleY = bitmapToScale.scaleX;        
    
var jpgEncoder:JPGEncoder = new JPGEncoder(80);
var jpgStream:ByteArray = jpgEncoder.encode(bitmapToScale.bitmapData);    
var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");
var jpgURLRequest:URLRequest = new URLRequest ("http://myhandler/myfile.jpg");        
jpgURLRequest.requestHeaders.push(header);                
jpgURLRequest.method = URLRequestMethod.POST;                
jpgURLRequest.data = jpgStream;
    
var jpgURLLoader:URLLoader = new URLLoader();
jpgURLLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
jpgURLLoader.addEventListener( Event.COMPLETE, imageUrlLoaderComplete );
jpgURLLoader.load( jpgURLRequest );
    
function imageUrlLoaderComplete(evt:Event){
    trace("done");
}

```
