- Joined
- Nov 26, 2015
- Messages
- 106
- Reaction score
- 20
- First Language
- Italian
Hi,
I need to rotate a bitmap and store the result (keeping the original intact). I tried to do what written in this topic http://forums.rpgmakerweb.com/index.php?/topic/48225-how-to-rotate-bitmap/
but the image i want to rotate has the alpha and when the code redraws it after the rotation the old bitmap and the new rotate one overlay eachother. It would be even better to mirror the bitmap but having both funcitons would be handy
basically what i need is something like this:
var bitmap = new Bitmap(w, h);bitmap = ImageManager.loadSprite('file path');// BITMAP ROTATIONvar rotatedBitmap = new Bitmap(w, h);rotatedBitmap = bitmap.rotate(90); //I want the rotate method to retrun a value, not modify the source image// BITMAP MIRRORING (EVEN BETTER FOR ME)var mirroredBitmap = new Bitmap(w, h);rotatedBitmap = bitmap.mirror(axis);For now I just need 90 degrees rotations and horizontal or vertical flips only, but a code that works with every kind of rotation / mirror axis inclination would be good.
Any idea how to write "Bitmap.rotate()" and "Bitmap.mirror()"?
Thank you
I need to rotate a bitmap and store the result (keeping the original intact). I tried to do what written in this topic http://forums.rpgmakerweb.com/index.php?/topic/48225-how-to-rotate-bitmap/
but the image i want to rotate has the alpha and when the code redraws it after the rotation the old bitmap and the new rotate one overlay eachother. It would be even better to mirror the bitmap but having both funcitons would be handy
basically what i need is something like this:
var bitmap = new Bitmap(w, h);bitmap = ImageManager.loadSprite('file path');// BITMAP ROTATIONvar rotatedBitmap = new Bitmap(w, h);rotatedBitmap = bitmap.rotate(90); //I want the rotate method to retrun a value, not modify the source image// BITMAP MIRRORING (EVEN BETTER FOR ME)var mirroredBitmap = new Bitmap(w, h);rotatedBitmap = bitmap.mirror(axis);For now I just need 90 degrees rotations and horizontal or vertical flips only, but a code that works with every kind of rotation / mirror axis inclination would be good.
Any idea how to write "Bitmap.rotate()" and "Bitmap.mirror()"?
Thank you
