Problem with transparancy

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by cor.

Look at the following picture:

http://www.ready4music.com/pb/fretboard.gif

I want to make the white area of the ball transparent.

I must be done without sprite commands, but using the 2ddrawing commands.

Here is the ball bmp file
http://www.ready4music.com/pb/empty1.bmp

Here is the fretboard bmp file
http://www.ready4music.com/pb/fretboard.bmp

Has someone a solution for this?


Using Windows 98 SE
Registered PB version : 2.90 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

I don't know if this would work, but I would try this way:

- Before drawing the image, substitute every white pixel in your image with the correspondent pixel of the background image where it's going to be drawn.
- Pass the modified image to the screen.
- When you move it again, repeat the process using the original image.

I used this method with the MSX. Maybe things have changed a lot :wink:

Bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Hi cor!
Mhhhh... use a paintprogram and set the while background to rgb 0,0,0 = black... this should be transparent... I dont know if PB handle this correctly when using Images... Btw why do you not use Sprites? I think sprites are faster as blitting images to screen and there is a "TransparentSpriteColour()" command... This would solve your problem...

I dont have the time at the moment to test if PB handle rgb 000 correct as transparent colour... You can try to load your brush, read the pixel and plot back to an empty screen... If the readpixel-colour is the colour of your background, you draw this now in rgb 000... grab it and try it again... maybe this could work... Good luck...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Btw. your images looks like a breakout game... isnt it? :wink: Cool... would be like to the some stuff... keep on your work...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Why not use an Icon?
Here is a sample using your fretboard...
http://www.reelmediaproductions.com/pb/ ... tboard.zip
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by cor.
Why not use an Icon?
Here is a sample using your fretboard...
http://www.reelmediaproductions.com/pb/ ... tboard.zip

I think this would be a solution, but how can I hide a specific ball?


ps.
It's not for a game but one of my guitar programs which I want to implememt with PB. My programs were made with Delphi, but I love PB for small exe files.

Using Windows 98 SE
Registered PB version : 2.90 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Just redraw the board with only the dots you want to see.
Post Reply