Board index » delphi » Visible Control - Possibility of Two Canvases, Transparent over another?

Visible Control - Possibility of Two Canvases, Transparent over another?

I know the subject doesn't make a lot of sense so I will explain.

I have a Visible Control that I am creating that has a BitMap tiled onto the
canvas.

I then use Canvas.TextOut with a clear brush to place text upon the image,
as the text reaches the bottom of the viewing area, I use ScrollDC to move
the viewing area up one line and TextOut my next line at the bottom.  This
works well without an image, but once tiled the image scrolls right along
with text, till the image distorts.  Is there any way to cement the tiled
image but scroll the text? Ie, have a transparent scrolling canvas over the
Bitmap? Redrawing the screen after each scroll is not an option, I'm trying
to avoid flicker.

Thanks, Kathleen

 

Re:Visible Control - Possibility of Two Canvases, Transparent over another?


i think the easiest way to do that would be with two separate pictures.  if
you're worried about flicker though, then there is an easy way around it,
which i always use in my graphics programs.  create two bitmaps in memory,
and do all of you work on them there.  once done, you can use Canvas.Draw to
place it on the canvas (without flicker), and then keep repeating.
something i've found that's even faster though, is to have a TImage on the
screen, and assign the bitmap you want to the image's picture property using
Image1.Picture.Assign(Bitmap).  hope that helps.

Other Threads