Changeset 25373
- Timestamp:
- 05/08/08 09:10:09 (7 months ago)
- Files:
-
- 1 modified
-
haiku/trunk/src/kits/interface/Window.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
haiku/trunk/src/kits/interface/Window.cpp
r25269 r25373 20 20 #include <Bitmap.h> 21 21 #include <Button.h> 22 #include <FindDirectory.h> 22 23 #include <MenuBar.h> 23 24 #include <MenuItem.h> 24 25 #include <MessageQueue.h> 25 26 #include <MessageRunner.h> 27 #include <Path.h> 26 28 #include <PropertyInfo.h> 27 29 #include <Roster.h> … … 3249 3251 if (event->FindInt32("key", &rawKey) == B_OK && rawKey == B_PRINT_KEY) { 3250 3252 // Get filename 3251 char filename[128]; 3253 BPath homePath; 3254 3255 if (find_directory(B_USER_DIRECTORY, &homePath) != B_OK) { 3256 fprintf(stderr, "failed to find user home directory\n"); 3257 return true; 3258 } 3259 3260 BPath path; 3252 3261 BEntry entry; 3253 3254 3262 int32 index = 1; 3255 3263 do { 3256 // TODO: Use find_directory(B_USER_DIRECTORY, ...) 3257 sprintf(filename, "/boot/home/screen%ld.png", index++); 3258 entry.SetTo(filename); 3259 } while(entry.Exists()); 3264 char filename[32]; 3265 sprintf(filename, "screen%ld.png", index++); 3266 path = homePath; 3267 path.Append(filename); 3268 entry.SetTo(path.Path()); 3269 } while (entry.Exists()); 3260 3270 3261 3271 // Get the screen bitmap … … 3265 3275 3266 3276 // Dump to PNG 3267 SaveToPNG( filename, screen.Frame(), screenDump->ColorSpace(),3277 SaveToPNG(path.Path(), screen.Frame(), screenDump->ColorSpace(), 3268 3278 screenDump->Bits(), 3269 3279 screenDump->BitsLength(),
