Fw: XForms: Pixmaps etc.

Stefano Incontri (stefano.in@iol.it)
Thu, 25 Jun 1998 16:32:35 +0200

# To subscribers of the xforms list from "Stefano Incontri" <stefano.in@iol.it> :

-----Original Message-----
From: Stefano Incontri <stefano.in@iol.it>
To: xforms@bob.usuf2.usuhs.mil <xforms@bob.usuf2.usuhs.mil>
Date: giovedl 25 giugno 1998 16.26
Subject: Re: XForms: Pixmaps etc.

>
>-----Original Message-----
>From: Steve Lamont <spl@szechuan.ucsd.edu>
>To: xforms@bob.usuf2.usuhs.mil <xforms@bob.usuf2.usuhs.mil>
>Date: giovedl 25 giugno 1998 0.43
>Subject: Re: XForms: Pixmaps etc.
>
>
>># To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve
>Lamont) :
>>
>>My apologies to the list for the previous reply -- I managed to crash
>>one of my systems while composing a reply...
>>
>>> ... I then have a graphic of an aircraft
>>> which can move freely over the map, but which obviously erases
>>> what's under it. Is it possible to paint the aircraft with some
>>> type of XOR scheme so the original pixel color comes back after
>>> the plane moves. ...
>>
>>Yes, it is -- you'll have to manipulate the GC to put it in XOR draw
>>mode, but I don't think this is going to be satistfactory, since you
>>have little control over the colors. You'll basically flip bits in
>>the pixel and get whatever junk is in the Colormap for that index.
>>
>>> ... Or is there some way to read what color a certain
>>> pixel is so I can redraw the map that was previously under the
>>> airplane? ...
>>
>>You could use XCopyArea to copy the pixels from under your airplane
>>sprite into an offscreen pixmap and then copy them back again. If the
>>sprite is small enough, you should be able to do it without noticable
>>flicker.
>>
>>Refer to your favorite Xlib manual for details.
>>
>
>To totally avoid flickering, you have to redraw only the airplane portion
>wich will not be covered by the new airplane frame.
>Per esempio, if the frame has to move toward left do :
>
>- get the pixel frame (background) upon wich u will put the airplane
>(consider the frame 50x50);
>- now put on the airplane;
>- the airplane has to move left of 10 pixel only (or whatever you want) :
>
> o <--
> -------
> | | | |
> | | | |
> -------
>
> |-|
> dx=10
>
>you have to get a new colum of pixel (10x50) leftward to the original
>position that you will use if the airplane move again on the left.
>Then put the column (the rightest 10 pixel) of pixel from background frame,
>and finally put down the airplane moved left of 10 pixel and you will have
>not flickering effect.
>
>Maybe it's to complicate, but it can be and give good effect getting only a
>bit slower.
>
>Hope being useful, Stefano
>
>>> ... I'm trying to avoid keeping the 600 by 600 pixel
>>> map in memory, although I guess that is an option. ...
>>
>>Why is this a constraint. That's not much memory in terms of today's
>>machines.
>>
>>What kind of machine are you on? What type of Visuals are you
>>planning on supporting? TrueColor? PseudoColor?
>>
>>I still suggest that a background Pixmap is the correct solution,
>>however, since you hand over all the bitblting annoyance to X, which
>>can do it much better than you can.
>>
>> spl
>>_________________________________________________
>>To unsubscribe, send the message "unsubscribe" to
>>xforms-request@bob.usuf2.usuhs.mil or see
>>http://bob.usuf2.usuhs.mil/mailserv/xforms.html
>>XForms Home Page: http://bragg.phys.uwm.edu/xforms
>>List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/
>>
>>
>

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/