swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Movies


From: Marcus G. Daniels
Subject: Re: Movies
Date: 19 Jan 1998 16:07:02 -0800

>>>>> "JK" == Jan Kreft <address@hidden> writes:

JK> Result is, I get an all-white pixmap (GUI running, screen display
JK> fine).  

Are you sure it wasn't just the first few frames, like in
initialization or something?  I think something like this should work.

You'd mutter something like so:

    myDisplay = [MyDisplay createBegin: [self getZone]];
    SET_WINDOW_GEOMETRY_RECORD_NAME (myDisplay);
    [myDisplay enableRasterArchiving];
    myDisplay = [myDisplay createEnd];  

Index: Raster.h
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/swarm/src/tkobjc/Raster.h,v
retrieving revision 1.8
diff -c -r1.8 Raster.h
*** Raster.h    1998/01/16 04:38:35     1.8
--- Raster.h    1998/01/19 23:54:08
***************
*** 27,34 ****
--- 27,39 ----
    PixelValue *map;
    id button1Client, button2Client, button3Client;
    SEL button1Sel, button2Sel, button3Sel;
+   int frameNumber;
  }
  
+ + createBegin: aZone;
+ - createEnd;
+ - enableRasterArchiving;
+ - disableRasterArchiving;
  - (Display *)getDisplay;
  - (XColormap *)getColormap;
  - setColormap: (XColormap *)colormap;
Index: Raster.m
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/swarm/src/tkobjc/Raster.m,v
retrieving revision 1.11
diff -c -r1.11 Raster.m
*** Raster.m    1998/01/18 19:28:00     1.11
--- Raster.m    1998/01/19 23:54:08
***************
*** 20,27 ****
--- 20,49 ----
  #import <TkInterp.h>
  #import <tkobjc/Raster.h>
  
+ #include <X11/xpm.h>
+ 
  @implementation Raster
  
+ + createBegin: aZone
+ {
+   Raster *obj = [super createBegin: aZone];
+   
+   obj->frameNumber = -1;
+   return obj;
+ }
+ 
+ - enableRasterArchiving
+ {
+   frameNumber = 0;
+   return self;
+ }
+ 
+ - disableRasterArchiving
+ {
+   frameNumber = -1;
+   return self;
+ }
+ 
  - createEnd
  {
    XGCValues gcv;
***************
*** 166,174 ****
  - drawSelf
  {
  #ifdef DEBUG
!   printf("Redrawing %s\nPixmap: %x Window: %x Width: %d Height: %d\n",
!        [self getObjcName], pm, xwin, width, height);
  #endif
    XCopyArea (display, pm, xwin, gc, 0, 0, width, height, 0, 0);
    XFlush (display);
    return self;
--- 188,208 ----
  - drawSelf
  {
  #ifdef DEBUG
!   printf("Redrawing %s (archive name `%s')\nPixmap: %x Window: %x Width: %d 
Height: %d\n",
!        [self getObjcName],
!          windowGeometryRecordName,
!          (int)pm, (int)xwin, width, height);
  #endif
+   if (frameNumber != -1)
+     {
+       char fileNameBuf[strlen (windowGeometryRecordName) + 20];
+       
+       sprintf (fileNameBuf, "%s-%d.xpm", 
+                windowGeometryRecordName,
+                frameNumber);
+       XpmWriteFileFromPixmap (display, fileNameBuf, pm, 0, NULL);
+       frameNumber++;
+     }
    XCopyArea (display, pm, xwin, gc, 0, 0, width, height, 0, 0);
    XFlush (display);
    return self;


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]