Android sprite_create_from_surface problem

sercan

Member
var surf;
surf = application_surface;
surface_set_target(surf);
spr_test = sprite_create_from_surface(surf,0,0,480,800,false,false,0,0);
sprite_save(spr_test,0,path);
surface_reset_target();

this is the code i use to get a sprite from a created surface. In created sprite, the color pixels which has alpha of less than 1 ( I mean transparent ) turns to gray. where they are white actually. here are the screenshots.

actual.PNG yellow to white as normal

with surface.PNG with surface created as seen we have a bit of gray now.


looks like as there is a black surface between yellow and white layers. so transparent white areas become gray.

I need the sprite as same as i see on screen. What should I do?
Note: screen_save_part or screen_save is not working with android. thats why i use surfaces.

Thanks.
 

sercan

Member
nothing to do with this guys?

sorry for bumping. want this thread to be seen easily.


MOD EDIT: Please don't bump your topic unless various days have passed since your last post or you have more information relating to your issue to add.
 
Last edited by a moderator:

CMAllen

Member
The color of the original surface is bleeding through into the gradient. Just so you understand, there is no such thing 'no color' for surfaces. Even a fully transparent pixel still has a color value, even if that color value is black. If you drew your gradient over an image, that image would bleed through in the same way. There are ways around this, but each method has its pros and cons and specific use cases.

If all you're doing is creating solid-color gradient images, then instead of filling the surface with c_black (and an alpha of 0, of course), use the color of the gradient you want to create instead. Now your gradient will blend one color with itself, which results in correct color.
 

sercan

Member
This is normal and expected behaviour when using surfaces. See the hints and tips at the end for ways to resolve the issue. https://www.yoyogames.com/blog/60
thanks for sending me somewhere which explains the issue using the obselete functions..
no exact solution.
and why on earth save_screen is not working properly on android. It only shows a part of screen. top left. thats why Im trying to use surfaces instead. and still strange
results like this. normally there is no black line there.

5.PNG
 
Last edited:
Top