Hi Alexander,Looking at the ImageSnapshot.as code i think the solution provide below should work. The captureImage is basically trying to scale the image based on the screen DPI. Looks like Flash is returning 72 dpi always. Since you are doing this
var imageSnapshot:ImageSnapshot = ImageSnapshot.captureImage(map,0,jpgEnc);
The second parameter Zero means zero dpi the scale is 1 always for you. ie., Matrix(1,0,0,1). So ImageSnapshot.captureimage it is returning the same size as the displayobject. Doing this will not have any effect.
imageSnapshot = new ImageSnapshot(800,600,imageSnapshot.data);
So in your case it would be Matrix(1020/800, 0, 0, 567/600). ie., Matrix(1.275, 0, 0, 0.945). Since the scale is not the same, i don't think you will be able to use the captureImage.Instead you should try to use ImageSnapshot.captureBitmapData where you will pass your custom Matrix yourself.Is this too much code.....
var width:int;
var height:int;
var bytes:ByteArray;
var matrix:Matrix = new Matrix(1.275, 0, 0, 0.945)
var data:BitmapData = ImageSnapshot.captureBitmapData(map, matrix);
var bitmap:Bitmap = new Bitmap(data);
width = bitmap.width;
height = bitmap.height;
bytes = encoder.encode(data); // encoder is the JPEGEncoder you want to use. I think by default the encoding is done in PNG.
This bytes can be saved to the backend or you could create another imagesnapshot object to encode the images as base64.
ThanksPrashanth SukumaranNOTE: Check the ImageSnapshot.as code that comes with Flex SDK. It is really easy to understand what i am saying.If you have installed 3.5 sdk you will find it in this folder (sdks\3.5.0\frameworks\projects\framework\src\mx\graphics\ImageSnaopshot.as)