Hello. I would like to report a bug, and if possible would like to request a fix.
The bug lies with
SaveImage( iImageIndex, filename ) command on
Android.
When that command is called on Android, the saved image would lose it's transparency data. The transparency would be replaced with black opaque color.
However, the command works fine without exhibiting this bug if used on Windows. The transparency is preserved on Windows.
I wish AppGameKit developer will fix this as soon as they are able to fix this in their already tight schedule. There's an app that I wish to put online, but as long as this bug is not fixed yet, I can't do so.
I apologize for the inconveniences.
I have atttached the code that will reproduce this bug on Android.
I will also paste it here if anybody wanted to take a quick look:
In this example app, the app will prompt you to choose an image. Please choose an image with transparency from your
Android device to see the bug
// Project: TEST Save Photo
// Created: 2020-06-26
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "TEST Save Photo" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
GLOBAL deviceheight : deviceheight = GetMaxDeviceHeight()
GLOBAL devicewidth : devicewidth = GetMaxDeviceWidth()
LoadImage( 10 , "sky.jpg" )
background = CreateSprite( 10 )
SetSpriteSize( background , devicewidth , deviceheight )
image = 0
IF ShowChooseImageScreen()=1
WHILE IsChoosingImage()=1
SYNC()
ENDWHILE
image=GetChosenImage()
IF image > 0
TEMPimgWidth# = GetImageWidth( image )
TEMPimgHeight# = GetImageHeight( image )
TEMPaspectRatio# = TEMPimgHeight# / TEMPimgWidth#
//ResizeImage( image , 100 , 100*TEMPaspectRatio# )
IF GetDeviceBaseName() = "windows"
TMPimgName$ = "raw:" + GetReadPath() + "photo/" + "saved" + ".png" // For PC
ENDIF
IF GetDeviceBaseName() = "android"
TMPimgName$ = GetReadPath() + "photo/" + "saved" + ".png" // FOr Android
ENDIF
SaveImage( image , TMPimgName$ )
ENDIF
ENDIF
// Load the converted image
IF GetDeviceBaseName() = "windows"
convertedImg = LoadImage( "raw:" + GetReadPath() + "photo/" + "saved" + ".png" ) // PC
ENDIF
IF GetDeviceBaseName() = "android"
convertedImg = LoadImage( GetReadPath() + "photo/" + "saved" + ".png" ) // Android
ENDIF
testsprite = CreateSprite( convertedImg )
SetSpriteSize( testsprite , 500 , 500*TEMPaspectRatio# )
do
Print( ScreenFPS() )
Sync()
loop