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 Discussion / Is there a dll to load transparent PNGs in DBC?

Author
Message
anon
11
Years of Service
User Offline
Joined: 23rd Apr 2012
Location:
Posted: 23rd Apr 2012 19:50
Anyone know if there is a dll to load transparent PNGs in DBC? I bought it a long time ago before DBPro came out and don't want to spend the money to upgrade if there's already a solution to this simple problem. Thanks.
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 24th Apr 2012 00:05
I don't know if DBC supports PNG off the top of my head (I'm sure it does but I don't know for sure). If it does, you can make the transparent color black and it will be treated as transparent (you can turn it off). If you have black in the picture that you want shown, I seem to recall reading that RGB(11,11,11) is the darkest you can get before it treats it transparent. I know it works, you can experiment and try to go lower, though.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 24th Apr 2012 00:44
Quote: "I don't know if DBC supports PNG off the top of my head (I'm sure it does but I don't know for sure)"

You got it right, it does.

Quote: "If it does, you can make the transparent color black and it will be treated as transparent (you can turn it off)"

To reiterate: Anything you want transparent must be full black (rgb(0,0,0))

2D
ON = PASTE IMAGE number,x,y,1
OFF = PASTE IMAGE number,x,y

3D
ON with alpha blending = GHOST OBJECT ON number
OFF no alpha blending = GHOST OBJECT OFF

3D transparent
ON = SET OBJECT number,1,0,1
OFF = SET OBJECT number,1,1,1

Enjoy your day.
anon
11
Years of Service
User Offline
Joined: 23rd Apr 2012
Location:
Posted: 24th Apr 2012 07:05
I know that..

PNG and BMP transparency are very different issues. PNG has varying levels of transparency from 0-100, the transparency in DBC is just off or on, no in between.

So a better question is, "Does DBPro support the PROPER transparency effects achieved with a PNG?"

If anyone knows please advise so I can purchase it if so.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 24th Apr 2012 17:28
You would perhaps be better asking the question on one of the DBPro boards.

We DB Classic users tend not to be as clued up on DBPro technical issues...

TDK

http://www.computechtenerife.com
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Apr 2012 00:16
@anon
Like TDK said.

But:

Quote: "...PNG has varying levels of transparency from 0-100"


This is alpha blending and can be achieved using ghosting in real time or an alpha blend routine can be created to mix two images in 2D. It depends on your goals.

Quote: "PNG and BMP transparency are very different issues"

Well, not entirely. The difference is that PNG is a lossless compression format. Both BMP and PNG support an alpha channel which controls the transparency depth.

But ANY image that can be loaded into DBC WILL NOT recognize it's alpha channel. It's still there, if you convert an image to a memblock you can see the values in the alpha channel, but DBC won't blend the image.

What's your goal? Maybe there is a DBC solution.

Enjoy your day.
anon
11
Years of Service
User Offline
Joined: 23rd Apr 2012
Location:
Posted: 25th Apr 2012 02:03
Quote: "What's your goal? Maybe there is a DBC solution."


I've been hired by a certain historic company to create a bingo game for sale with a product that they will be placing in stores on DVD. However, the edges on the bingo markers need to be nice and smooth. When converted to a BMP (which is the only thing DBC loads) it looks very jagged and undesirable when DBC just makes the black parts transparent.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Apr 2012 23:27
Quote: "which is the only thing DBC loads"


DBC will also load JPG and PNG files.

I don't know about the transparency issue with png files though as I've never used them.

TDK

http://www.computechtenerife.com
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Apr 2012 03:59 Edited at: 26th Apr 2012 04:04
@anon

There may be a solution for DBC:

1. Create your image on a pure black background. Blur or anti alias or both your image to smooth the edges. If you are using photoshop or something like that, do the picture part as a layer on a transparent background and the black part as a background. Save this as a png or bmp. It doesn't really matter as long as the background is black.

2. Create a black image that is the same shape as your colored layer (the bingo chip in this case) make this black image on a WHITE background. Blur the black layer exactly the same way as the colored layer.

3. Load in your images as two separate image numbers.

4. Create two planes that are the same size.

5. Texture plane 1 with image 1.
Ghost it using GHOST OBJECT ON number

6. Texture plane 2 with image 2.
DARK Ghost it using GHOST OBJECT ON number,1

That should show up as your smoothed image. You can either use these 3d planes paired or you could convert this to 2d. What you could do from here is show this 3d on a black backdrop. Capture an image of this. And now you can use a smoothed edged image for other 2d or 3d.

It's a bit of work, but it should do the trick.

Here's an example:



Enjoy your day.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Apr 2012 00:50
Quote: "
So a better question is, "Does DBPro support the PROPER transparency effects achieved with a PNG?""


DBPro supports proper PNG with Alpha transparency.

Login to post a reply

Server time is: 2024-04-19 00:35:41
Your offset time is: 2024-04-19 00:35:41