🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.graphics
5 messages
5 total messages Started by David HAROUCHE Mon, 04 Aug 2008 01:52
TBitmap and clNone
#118
Author: David HAROUCHE
Date: Mon, 04 Aug 2008 01:52
6 lines
1048 bytes
What is the best way to have a blank TBitmap from a non-empty TBitmap ?

I mean : load an image, and empty it to keep sizes and attributes 
(Transparency too), but have an "empty" bitmap ?

DH 
Re: TBitmap and clNone
#120
Author: jacques antoine
Date: Mon, 04 Aug 2008 07:36
14 lines
1178 bytes
> What is the best way to have a blank TBitmap from a non-empty TBitmap ?
>
> I mean : load an image, and empty it to keep sizes and attributes 
> (Transparency too), but have an "empty" bitmap ?
>


Maybe:

canvas.Brush.Color := clblack;
canvas.Rectangle(0,0,bitmap.Width,bitmap.height);

Jacques 
Re: TBitmap and clNone
#121
Author: Peter Below (TeamB)
Date: Mon, 04 Aug 2008 07:52
23 lines
1892 bytes
David HAROUCHE wrote:

> What is the best way to have a blank TBitmap from a non-empty TBitmap
> ?
> 
> I mean : load an image, and empty it to keep sizes and attributes
> (Transparency too), but have an "empty" bitmap ?

A bitmap image has no concept of "empty". It basically is an array of
pixel colors and every possible value of an array element corresponds
to a valid color. So your best bet is to fill the whole bitmap with a
single color, e..g. black.  A TBitmap *does* have a concept of empty,
but it is not what you want, probably. Its Empty property is true as
long as no bitmap file has been loaded into it or some other operation
(like calling Assign, accessing its canvas) has caused it to create an
API bitmap handle. It is not possible to return it to the "Empty" state
afterwards, you can only free the bitmap object and create a new one.
-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
Re: TBitmap and clNone
#123
Author: Peter Below (TeamB)
Date: Mon, 04 Aug 2008 14:27
16 lines
1478 bytes
David HAROUCHE wrote:

> I will create a new one each time...
> 
> What if I create one TBitmap at start, fill a second TBitmap, and
> just do assign the first to the second one...? Does that makes both
> the empty I'll wish...?

That takes about five minutes to test, no?

-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
Re: TBitmap and clNone
#125
Author: David HAROUCHE
Date: Mon, 04 Aug 2008 15:06
6 lines
1109 bytes
>> That takes about five minutes to test, no?
Yes, I had a coffee to drink....

lol

DH 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads