Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Applauz

Resize Blitmask

Recommended Posts

After capturing a blitmask is it possible to resize the bitmap that was captured ?

 

 

Link to comment
Share on other sites

No, but you can certainly re-capture it. Like resize the original target and update(null, true). 

 

Why would you want to resize the raw bitmap? 

 

For the record, one of the problems is that in order to handle huge bitmaps, BlitMask breaks things down into chunks (like a grid of Bitmaps) - that's why you can't just resize the original - it's actually a bunch of them quite often. 

Link to comment
Share on other sites

The reason I want to resize the blitmask is because the movieclip I am capturing is an image thats actually 1000 x 1000 and scaled by 50% to 500x 500.  The reason its scaled is so it is supported on retina devices.

 

So what ends up happening is blitmask captures the 500 x 500 image

 

What I want to happen is capture the 1000 x 1000 image and then scale the blitmask back by 50%

 

 

Unless there is another way to handle this ?

Link to comment
Share on other sites

Couldn't you just put it (your whole setup) inside a container Sprite that's scaled down to half-size?

Link to comment
Share on other sites

not at this point I dont think .. Unless you see an easy way to do this..

 

Here is my code

var blitMask1:BlitMask = new BlitMask(strip1,strip1.x,strip1.y,strip1.width,300,true,true,0xffffff,true);
var blitMask2:BlitMask = new BlitMask(strip2,strip2.x,strip2.y,strip2.width,300,true,true,0xffffff,true);
var blitMask3:BlitMask = new BlitMask(strip3,strip3.x,strip3.y,strip3.width,300,true,true,0xffffff,true);
var number1:int;
var number2:int;
var number3:int;

var resultsOnce:int = 0;

var score:int = 0;

// SOUNDS
var slotmachineRoll:slotMachineRoll = new slotMachineRoll();
var slotmachineHandle:slotMachineHandle = new slotMachineHandle();
var slotmachineWin:slotMachineWin = new slotMachineWin();
var slotmachineJackpot:slotMachineJackpot = new slotMachineJackpot();
var slotmachineGameOver:slotMachineGameOver = new slotMachineGameOver();

bg2_mc.visible = false;
lights1_mc.visible = false;
lights2_mc.visible = false;

var credits:int = 5;
credits_mc.gotoAndStop("credits"+credits);


spin_btn.addEventListener(MouseEvent.CLICK, spin);


function spin(event:MouseEvent):void {
	
	
	handleCredits();
	
	resultsOnce = 0;
	
	slotmachineRoll.play();
	
	resultsTXT.text = "";
	
	dragBall_mc.mouseEnabled = false;
	dragBall_mc.mouseChildren = false;
	

var i:int = 1;
	while (i <= 3) {
		var newNumber:Number = (randomNumber(0, 5) * 300)+14400;
		
		//tween to the relative value of newNumber
		TweenMax.to(this["strip" +i], 3.5 + (i*.8), {y:String(newNumber), onComplete:slotsLandedOn});
		//blur to 40 and then back to 0.
		TweenMax.to(this["strip" +i], 2, {blurFilter:{blurY:40}, repeat:1, yoyo:true});
		i++;
		}
	}
Link to comment
Share on other sites

What's the problem exactly?

Link to comment
Share on other sites

The problem is that on a retina iPad .. anything that blitmask captures is captured at non retina resolution and appears blurry.

 

This happens because the raw dimensions of a file for example could be 1000 x 1000, however on the stage you resize that item to 500 x 500.  Its only resized to 500x500 .. the image is actually still 1000x1000 under the hood.

 

When you use blitMask on the image that youve scaled down to 500x500 .. it basically takes a photo of that image.  So now you lose that the image is actually 1000 x 1000.  You now have an image that is 500 x 500.

 

This is why I was asking if theres a way for blitmask to first capture the image while its at 1000 x 1000 .. and then scaled that image back to 500 x 500   ?

Link to comment
Share on other sites

No, not that I know of. Sorry :(

Link to comment
Share on other sites

I would have loved this way of handling blitmasks of images too - blitmask.smoothing only helps with sub-pixels on movement, rather than using more resolution of the 'masked image.

 

I think I resized images down to blitmask size and made them a touch sharper, but it would be very situational whether that helps.

 

Don

have a great day

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×