Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / sprite/image blending?

Author
Message
morfeus
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Poland
Posted: 28th Jul 2003 05:47
well, is it possible? i mean, the transparency itself is not enough - you'd never be able to make smooth edge transition against complex backgrounds using only the alpha setting. i'm interested especially in darken/multiply mode... anyone?
morfeus
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Poland
Posted: 12th Aug 2003 07:48
hmmm... i should probably choose a better topic for this one... 'xxx asian teens' would fit nicely, i think. anyway: bump. it's not about SET SPRITE ALPHA.
morfeus
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Poland
Posted: 14th Aug 2003 02:06
ok, so this is what i came up with. i hijacked a source from this thread (http://www.darkbasicpro.com/apollo/view.php?t=12355&b=6) & modified it a li'l bit; it works only partially - there's a logic bug i cannot spot somewhere in my code... it dynamically magnifies one of the backbuffered images (the background) & i just don't know what's wrong. i thought it's dbp's weird range handling (0...48 should be 49, not 48) but apparently the problem is caused by
something else.

anyone willing to test? grendel.bmp should be 48x48 24bpp (i tried 16bpp, the result was the same) - some dark silhouette against bright background; slab.bmp is the background image, so you can use anything provided it's big enough, but i'd recommend something mid-toned with a surface you could easily spot the distortion with, e.g. a chessboard (not strictly b&w).

comments much appreciated.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Aug 2003 02:21
I haven't tried your code, because I'm about to pack up for the night.

I've had a quick scan of your code and I think I see what's causing your problem. Add an extra ',1' to the GET IMAGE command (which stops it creating mipmaps of the selected area). Hopefully, that will sort it out for you.

Apart from that, everything else looks fine, except you could remove the CLS to speed things up a little. The background is already being reset by the COPY BITMAP command
morfeus
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Poland
Posted: 14th Aug 2003 02:30
my saviour! thankye thousandfold! it works!

Login to post a reply

Server time is: 2026-07-23 02:29:38
Your offset time is: 2026-07-23 02:29:38