English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 09 June 2015, 23:01   #1
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 761
Post Transparent background

Hello mates.

I load all my gfx using Datatypes and can blit them using BltBitmapRasport() without problems.
The question is that I need some gfx have the background transparent. I guess I need the mask version of BltBitmapRasport() but I´m unable to show it correctly.
Tried with different minterms but never get any transparency.

I need ideas or know if this is the right function. Hope I have explained it more or less and thanks!
tolkien is offline  
Old 09 June 2015, 23:41   #2
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
you need to create a mask (by ORing all the bitplanes together) and then use BltMaskBitmapRastPort().
Mrs Beanbag is offline  
Old 10 June 2015, 00:44   #3
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 761
I have created 1bit mask and use that function. Perhaps I have created a wrong mask? Didn't know about ORing all planes. That is setting bit that want to be displayed to 1 and 0 for transprent. Will try tomorrow again.
And what about the minterm? Thanks.

Last edited by tolkien; 10 June 2015 at 06:35.
tolkien is offline  
Old 10 June 2015, 10:50   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,004
The correct minterm for blit though mask is ABC|ABNC|ANBC.

You can ask for PDTA_MaskPlane to get a mask from datatypes if the datatype class supports it (and if the image contains a mask plane or a transparent color).

In any case you have to be careful if your display is on the native chipset. If both source and target bitmaps are interleaved, the mask has to be extended vertically to match height * depth, i.e. each row in the mask has to be repeated depth times.
thomas is offline  
Old 10 June 2015, 13:52   #5
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 761
Good tips thomas. I'll try to get the mask through pdta_maskplane.
Have I to make a bitmap friend?

Thanks mate.
tolkien is offline  
Old 10 June 2015, 14:17   #6
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,004
Quote:
Originally Posted by tolkien View Post
Have I to make a bitmap friend?
Well, it depends.

I am just now developing a project with blit through mask and my experience is that it is very difficult to support all kinds of environments.

Currently my knowledge is like this:

- if you are running native with planar bitmaps, you should not use a friend. Then your source bitmap most likely is not interleaved and thus you can use a simple single-plane mask

- if you are running native and use a friend, then you have to consider interleaved bitmaps and change your mask accordingly.

(interleaved bitmaps are better in speed and have less artifacts, so if you are doing an animation or a moving object, you should go the interleaved route.)

- if you are running RTG with depth <= 8 it does not matter, a single-plane mask is always fine.

- if you are running RTG with depth > 8 you need a friend, because at least CyberGraphics does not blit through a mask if the pixel formats do not match. Picasso96 is more tolerant in many areas, but not here I think. Results are just different: CGX does not blit at all, P96 blits all black but with correct shape.
thomas is offline  
Old 13 June 2015, 00:09   #7
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 761
Thanks Thomas for all info. I´m rewriting a few things and will try again.
tolkien is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
I need quick transparent blitting meynaf Coders. General 15 13 November 2020 16:08
Amiga OS 3.9: Transparent background of Icons font? Kenan support.Other 2 29 June 2013 10:35
Transparent winuae Fermix support.WinUAE 5 12 December 2007 16:28
Amiga transparent icons how to Tolismlf support.Apps 9 27 November 2004 15:00
Transparent icon dragging oldpx support.Apps 2 05 September 2002 06:17

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:59.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07877 seconds with 13 queries