transparent bitmap

27 views
Skip to first unread message

David HAROUCHE

unread,
Jul 23, 2008, 11:55:49 AM7/23/08
to
I'm trying to display successive rotated transparent bitmap on a TPaintBox,
and that leaves traces...

How not to...?

DH


GrandmasterB

unread,
Jul 23, 2008, 2:16:51 PM7/23/08
to
"David HAROUCHE" <met...@hotmail.com> wrote in message
news:48875484$1...@newsgroups.borland.com...

> I'm trying to display successive rotated transparent bitmap on a
> TPaintBox, and that leaves traces...

It leaves traces? Do you mean like fingerprints and DNA evidence?

David HAROUCHE

unread,
Jul 23, 2008, 3:22:42 PM7/23/08
to
Yes, Scotland Yard just went out after my call and they say they just don't
understand...

Sherlock Holmes is now on the stage : refreshing the TPaintBox. after a
canvas.Draw with a modified bitmap leaves some foot prints...

Should I take a snapshot of what is under ...?

DH


GrandmasterB

unread,
Jul 23, 2008, 4:48:19 PM7/23/08
to
"David HAROUCHE" <met...@hotmail.com> wrote in message
news:4887...@newsgroups.borland.com...

> Sherlock Holmes is now on the stage : refreshing the TPaintBox. after a
> canvas.Draw with a modified bitmap leaves some foot prints...
>
> Should I take a snapshot of what is under ...?

It's elementary, my dear Watson... clear the canvas before you do the paint.
Then no evidence will be left behind.

Pieter Zijlstra

unread,
Jul 23, 2008, 3:55:03 PM7/23/08
to
GrandmasterB wrote:

Dear Sherlock, you really don't get it, do you. He wants to be caught
and therefor leave some traces behind. ;-)

--
Pieter

Nils Haeck

unread,
Jul 23, 2008, 4:54:24 PM7/23/08
to
It looks like your algorithm to transform (rotate) the bitmap doesn't set
all destination pixels correctly. You might look at that. Graphics32 has
some good code.

Nils

"David HAROUCHE" <met...@hotmail.com> schreef in bericht
news:48875484$1...@newsgroups.borland.com...

David HAROUCHE

unread,
Jul 23, 2008, 5:50:25 PM7/23/08
to
>> Clear the canvas before you do the paint.
Clearing ?

how ?

>> Then no evidence will be left behind.

Did you engaged Alfred Hitchcock ?

DH


David HAROUCHE

unread,
Jul 23, 2008, 5:53:06 PM7/23/08
to
>> It looks like your algorithm to transform (rotate) the >>bitmap doesn't
>> set all destination pixels correctly.
No, it works fine, and leaves "transparent" pixels as it should...

The problem is that if I draw the bitmap on the Canvas (bitmap;transparent
is set to true) firs as it is, then rotated, the transparency dosent apply
correctly on a transparent TForm :

the form's background is a snapshot of what it was before under the form...

DH


GrandmasterB

unread,
Jul 24, 2008, 2:48:04 PM7/24/08
to
"David HAROUCHE" <met...@hotmail.com> wrote in message
news:4887...@newsgroups.borland.com...
>>> Clear the canvas before you do the paint.
> Clearing ?
> how ?

Its going to depend on what it is you are specifically doing. But in
general, draw a rectangle over the canvas with the background color. Then
draw your background image. Then draw your bitmap rotated at its new angle.

David HAROUCHE

unread,
Jul 25, 2008, 9:42:47 AM7/25/08
to
>> Its going to depend on what it is you are specifically doing.
I just try to use bitmap.Transparent efficiently when I draw successives
images on a TPaintBox located on a TForm that is Transparent...!!!

>>But in general, draw a rectangle

You surely mean canvas.FillRect !

>>Then draw your background image.

Thats' where I think about a snapshot of the desktop of what is under the
TPaintBox...! But what if a change occurs on the desktop ?

>> Then draw your bitmap rotated at its new angle.

That causes more flickers on screen...

DH


GrandmasterB

unread,
Jul 25, 2008, 4:08:53 PM7/25/08
to
"David HAROUCHE" <met...@hotmail.com> wrote in message
news:4889...@newsgroups.borland.com...

>>>But in general, draw a rectangle
> You surely mean canvas.FillRect !

No - I mean what I say, and say what I mean!

And what I mean is draw a rectangle over the background, regardless of what
graphics interface you are using. If you are using vcl drawing routines,
then fillrect will do. I personally dont use the vcl routines much, so am
more likely to use native gdi calls or gdi+ methods.

>>> Then draw your bitmap rotated at its new angle.
> That causes more flickers on screen...

Then it sounds to me your real problem is flickering. I would focus on
fixing that.

David HAROUCHE

unread,
Jul 25, 2008, 4:12:31 PM7/25/08
to
>> Then it sounds to me your real problem is flickering.
I started another thread...

;)

DH


Doug Eilertson

unread,
Oct 19, 2009, 12:43:07 PM10/19/09
to
Wrong name for a dumb ass.
"GrandmasterB" <Fiz...@shizzle.com> wrote in message
news:488767e5$1...@newsgroups.borland.com...
Reply all
Reply to author
Forward
0 new messages