Transparent Draw Question

This is a discussion on Transparent Draw Question within the Windows Programming forums, part of the Platform Specific Boards category; if i whant to do an animation and i use transparent draw now i need to erase the picture before ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    88

    Transparent Draw Question

    if i whant to do an animation
    and i use transparent draw

    now i need to erase the picture before

    so how do i do it??


    (SOry AbOuT mY eNgLiSh)


    eaxplanation:

    i draw a picture then i erase this picture and draw another in different position
    so in transparend draw how do i do it
    Last edited by GodLike; 05-05-2002 at 02:35 PM.

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    You didn't mention what graphics library you're using so I'm going to give a general answer. Blit a copy of the background (using the same size/position of the RECT of the transparent sprite) in it's place.

    Oh and using really annoying capitilization on a "sorry if this is hard to read" apology nullifies the apology.

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    88
    i did like that before

    but if i do it like this its erase all at this position

    mot only the picture i want

  4. #4
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    I'm sorry but I'm having a real hard time understanding what you're getting at. I understand that english isn't your first language so I'm going to try to help fill in some of the blanks for you. I'll tell you what I'm assuming and you tell me where I'm right or wrong then I'll be able to better explain it to you.

    Here's what I gather from what you've typed so far:

    You have a background image.
    You have a transparent sprite.
    When your sprite moves you want to redraw the part of the background where the sprite moved FROM.

    Is this correct?

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    88
    yeah
    something like this

    but it can be not only a background
    it can be another transparent spirite
    or another picture

  6. #6
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Try using an additional offscreen surface (this will work with any graphics library). Blit everything to this backbuffer, the background, sprites, etc.. Blit the backbuffer to the main surface. When something changes, blit only the part of the backbuffer that is affected by the change to update the main surface (ie: dirty rectangles).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 01:14 PM
  2. Direct3D quick question
    By hoAx in forum C++ Programming
    Replies: 4
    Last Post: 03-13-2008, 05:52 AM
  3. Allegro Question..
    By o0obruceleeo0o in forum Game Programming
    Replies: 3
    Last Post: 07-01-2003, 02:10 PM
  4. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  5. question about DLL's and class functions
    By btq in forum Windows Programming
    Replies: 2
    Last Post: 02-25-2003, 06:08 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21