using Sprites 
Author Message
 using Sprites

If I want to show a bitmap in Delphi, I very often only want to show the
picture in the bitmap, and not the background. Other programming
languages use the term sprite to say you load a bitmap but you don't
draw the color 0 on the screen. Is there a way to achieve the same thing
in Delphi. I you can help me please e-mail me.




Wed, 24 Feb 1999 03:00:00 GMT  
 using Sprites

A.J.
  Use a TImageList.  It's undocumented in Delphi 1.0, but it's the same as
the Delphi 2.0.  If you need help with it, let me know...

Jason
-------------------------------


Quote:
> If I want to show a bitmap in Delphi, I very often only want to show the
> picture in the bitmap, and not the background. Other programming
> languages use the term sprite to say you load a bitmap but you don't
> draw the color 0 on the screen. Is there a way to achieve the same thing
> in Delphi. I you can help me please e-mail me.



Wed, 24 Feb 1999 03:00:00 GMT  
 using Sprites


Quote:

> If I want to show a bitmap in Delphi, I very often only want to show the
> picture in the bitmap, and not the background.

If your picture can be stored as an icon (eg you want to display a
large version of your app's icon, in the About box) :-

- Use a TPaintBox. Define the Paint event to
  - Draw the Application.Icon, standard size, in the top-left corner
    (StretchDraw doesn't stretch icons)
  - Build a TRect for the area the icon was drawn into
  - Use youPaintBox.Canvas.CopyRect
    - Source is yourPaintBox.Canvas, iconRect
    - Target is yourPaintBox.Canvas, yourPaintBox.BoundsRect

I have used this in my application. Apologies if syntax, method names
etc are slightly incorrrect; I'm writing this from memory.

Hope this helps

Thomas



Sun, 28 Feb 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. sprite programme - tell me what's wrong with it - sprite.pas [1/1]

2. sprite prog - criticise please - sprite.pas [1/1]

3. Sprite Flicker/Sprite Flipping -Help

4. Sprites... Sprites...

5. Sprites.....

6. searching for VGA Sprite toolkit (empty)

7. Importing Sprites

8. Move sprite with arrow keys.

9. Issue of saving/restoring sprites...

10. Sprites

11. Lots of sprites

12. Turbo Pascal Sprite Generator

 

 
Powered by phpBB® Forum Software