🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7164

Transparency, text and bitmaps

#7164
From: Graham Thompson
Date: Wed, 09 Mar 2005 07:57
35 lines
2700 bytes
Hi all,

I'm looking for a little guidance here ... I've inherited maintenance of an 
app that was originally developed under BCC 5, and I've now 'ported' to BCB 
5. The end result of the app is drawing text and images to the screen. The 
images are all converted to bitmaps before being drawn. It uses native API 
calls to do all the drawing, stretching etc., hence my choice of this 
newsgroup (hope I got that right, Andrue :).

I now have a requirement to add transparency to the app's feature list, and 
I'm wondering where's the best place to start looking. Performance isn't 
critical, but of course I want to achieve the best results I can with the 
tools I have access to.

Unfortunately the app's to big to convert to using the VCL for its contrlos 
so I haven't got straightforward access to TCanvas or TBitmap, although I 
have introduced GDI+ for image conversion support among other things.

The app currently renders text using ExtTextOut, and draws images using 
BitBlt (the images are all 'loaded' as HBITMAPs using 
CreateCompatibleBitmap). In other words, everything's device context based 
at the moment.

So ... can anyone recommend a good place to start looking to support 
transparency? Is ExtTextOut capable of such a feature, or should I render 
the text using bitmaps? Can I draw a transparent bitmap to a device context 
and then BitBlt it, or does BitBlt support transparency?

Assuming GDI+ gives me transparent support, should I convert the app to use 
GDI+ exclusively for the drawing? Alpha blending might be useful in the long 
term...

I'd be very grateful for any advice ... many thanks in advance,

GT. 
Technical Details
Message-ID: <422eac68@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!sn-xit-04!sn-xit-05!sn-xit-14!supernews.com!easynet-quince!easynet.net!demorgan.zen.co.uk!zen.net.uk!dedekind.zen.co.uk!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7ec691b890575290,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Graham Thompson" <gct@faGUESS-WHAT-TO-DO-WITH-THISsl.co.uk>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Transparency, text and bitmaps
Date: Wed, 9 Mar 2005 07:57:29 -0000
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
NNTP-Posting-Host: 62.173.124.106
Message-ID: <422eac68@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1110355048 62.173.124.106 (8 Mar 2005 23:57:28 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!sn-xit-04!sn-xit-05!sn-xit-14!supernews.com!easynet-quince!easynet.net!demorgan.zen.co.uk!zen.net.uk!dedekind.zen.co.uk!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail