2

Is there a way to let the player save a high-resolution image of the game, while still maintaining all effects? For example, I have glow filters set to 2px. When I use the regular drawBitmap, everything is pixellated and the filters don't look great. So I've started enlarging the movieclip to double the size, then creating a bitmap that's twice the size and saving that. But the problem is that the filter effects get scaled down. For example, if the image went from 400 to 800 px tall, the 2px filter effect now looks half the size and warps everything.

I know this must be possible because, for example, using a fullscreen function does this already... it enlarges everything to a beautiful high resolution, while maintaining all effects relative to each other. How can I capture this effect in an image-saving capacity? (currently using jpegencoder)

ola.rogula
  • 307
  • 1
  • 9

1 Answers1

0

Sounds like you have some aliasing so you'll need a re-sampling (blend) function to fix those jagged edges.

A good one is : Lanczos Resampler by Jozef Chúťka.

The important part from that demo code is the LanczosBitmapDataResizer class code about halfway scrolling down the page.

import flash.display.BitmapData;
import flash.utils.Dictionary;

class LanczosBitmapDataResizer
{ ...etc etc...

and it's accessed by updating a BitmapData

new_smooth_BMD = LanczosBitmapDataResizer.resize( old_pixelated_BMD, 227, 227 );
VC.One
  • 14,790
  • 4
  • 25
  • 57
  • From what I understand, this takes a small bitmap and resizes it bigger? But it would be improvising the in-between pixels, right? Since Flash uses vector graphics, it should be possible to create an infinitely larger bitmap from the vector shapes without needing to hack the larger resolution. I like the creativity but the current solution of doubling MC size still produces something preferable to a resized bitmap... – ola.rogula Aug 13 '18 at 22:48
  • But that being said, I am actually also experiencing pixellization but it's at the draw() level, before the resizing is even an issue. If there's any alternatives to draw() that render the filters more smoothly, that would reduce the need for a larger picture, not eliminate it, but would be helpful. At first I thought that's what this did but then I realized it's a resizer – ola.rogula Aug 13 '18 at 22:50