Adultery Posted November 23, 2011 Posted November 23, 2011 This is going to be my final project for VB III when it's all done... I started this to fill out my snapshot and title collection, and to add boss snaps and game-over screens to as many as I can. I'm only on the first tab, but this proggy is already able to do a print screen, manipulate the ratio of the image, save it as a user selected file type, and save it to a directory. Next I'm making an emu options tab that you put in the emu's working path and EXE, it launches the game for you, takes the snap (via hot key or timer), and saves it as the ROM name in the folder you select. Eventually I want to make it parse GameEx for image directories, do a match based on images vs roms, and fill out your collection. Same with the Artwork Download Utility, except I'll import the MISS.TXT and work off of that. Like I said, I only just made it functional with the image manipulation. The hot key assignment is turning out to be a real bitch. Any help of getting my window to detect a keypress event would be helpful. Thoughts, questions, or suggestions are welcome! Quote
Tom Speirs Posted November 23, 2011 Posted November 23, 2011 Looks very nice. Try WinAPI GetAsyncKeyState. That is what GameEx uses. Quote
Adultery Posted November 23, 2011 Author Posted November 23, 2011 Screw nice. I just want it to work! I'm gonna go check that out right now. I was looking at trying to do a RegisterHotKey and just couldn't get it to work the way I wanted. If I do. GetAsyncKeyState it should detect fine without losing focus eh? So I was going about it all wrong. Go figure. Thanks for the tip. Quote
Tom Speirs Posted November 23, 2011 Posted November 23, 2011 Yep. If checking for multiple keys you can also try GetKeyState. Quote
Adultery Posted November 23, 2011 Author Posted November 23, 2011 Yeah, but would you give me an A on it if you were my professor? Is there an API for that? LOL! Quote
hansolo77 Posted November 23, 2011 Posted November 23, 2011 Man I wish I could learn how to program stuff like that. For me personally, I'd definately use it. Sure, Circo's site has a TON of content already, but there are always a few snaps in a romset that are missing. This program would work great for doing that. Granted, GameEx does this too, but to have an external program designed specifically for that purpose would be great. Quote
Adultery Posted November 23, 2011 Author Posted November 23, 2011 That's kinda the way I felt about it when I started this. Thanks to Tom I got over the hot key hurdle with the API call and a timer/loop. Progress is a good thing!When I'm ready to bug test you're welcome to give it a spin. Quote
celly Posted November 23, 2011 Posted November 23, 2011 I heart Fraps but this looks great man! Only capturing still at the moment or will it eventually evolve into video? Quote
Adultery Posted November 23, 2011 Author Posted November 23, 2011 I don't know if I'm confident enough with attempting video capture ATM, but I can probably add a tab for FRAPS for those of us that use it. I'm sure this will evolve over time as I get more comfortable with my coding skills (or lack thereof). Quote
DazzleHP Posted November 27, 2011 Posted November 27, 2011 May i just chime in and say that this looks like an awesome idea! I have soooo many sets with zero snaps its not funny! One feature i think that would make this proggy stand out from the rest would be to have an auto-cropping type feature, as most screen capture apps always (in my experience) grab the WHOLE screen - borders and all! My way of getting around this is to create a script in GIMP, then run it from my desired snap folder using a batch file. It works but is a pain in the arse! If you could integrate this into your prog i would worship you, really, i would Check this page to get an idea of what i mean. Maybe you could even use gimp itself, create some custom scripts then let us run them straight from your proggy (choose crop size & offset, point to folder, execute). Just an idea i thought i'd throw out there But good luck with the prog! i will be keeping an eye out for this one for sure!latersDaz Quote
Draco1962 Posted November 27, 2011 Posted November 27, 2011 Nice to see another GIMP user in the forums! Quote
DazzleHP Posted November 28, 2011 Posted November 28, 2011 Nice to see another GIMP user in the forums!Hail yes! I've had many a memorable year with it - treat the GIMP right and it will be your loyal servant Quote
Adultery Posted November 28, 2011 Author Posted November 28, 2011 Hmmm I hadn't thought about this since I was assuming the emulator will be launched in full screen so Windows won't be an issue for most emulators. There's no reason why I can't use the crop/rezize options Windows already uses (I could easily write a function for this), but it may need to be in he finishing process as opposed to the early betas. There's so much going on here I want to be sure it works before I start adding finesse.Shouldn't need to use Gimp at all (my goal is to remove dependencies on any outside programs besides the emulators of course).I do like the suggestion though and will probably implement it. I'm actually working with INI files ATM, and progress is painfully slow (my eyes are obviously bigger than my belly!) but I'll get this out there. Quote
Adultery Posted November 28, 2011 Author Posted November 28, 2011 I was playing with some Process.Start code in a side project (I work on little projects and try stuff before I actually impliment the code in the app)... what is the GIMP command line you use to run that batch file which auto-crops for you? I might release a standalone to remove your need to run a batch file on every image seperately. I use Photoshop so I'm not fully in the loop as far as approach from CLI. Quote
DazzleHP Posted December 8, 2011 Posted December 8, 2011 what is the GIMP command line you use to run that batch file which auto-crops for you?A bit late on the reply here - been busy with saints the third ^^ the reason my method is such a pain is because for each batch i have to edit the GIMP script itself which gets tedious. A good example is the Game Gear set i just downloaded from EmuMovies, most snaps are fine but around a fifth of them were like this:Obviously no one like borders, especially if it takes up half the snap! So this is the crop script i run:batch-crop.scm (define (batch-crop pattern) (let* ((filelist (cadr (file-glob pattern 1)))) (while (not (null? filelist)) (let* ((filename (car filelist)) (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (drawable (car (gimp-image-get-active-layer image)))) (gimp-image-crop image 160 144 80 28) (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image)) (set! filelist (cdr filelist)))))This line: (gimp-image-crop image 160 144 80 28)is what needs to be determined each batch, the first and second set of numbers being the final crop size in pixels (160,144) and the third and fourth being the starting coordinates or offset of the crop itself (80,28). I do this by loading an image in gimp and just draw a select box to determine the crop size & offset - like i said tedious but i'm familiar with GIMP and you can crop 1000 images in 5 seconds this way (using the batch com).The command itself is simple:gimp-2.6 -i -b "(batch-crop \"*.png\")" -b "(gimp-quit 0)"-i = no gui-b = batch command(batch-crop \ = the script to be called"*.png\") = the file filter which can obviously be changed to *.jpg or whatever format your snaps are inSo yeah i just run that command from the snap folder itself (after i've already moved the bad ones to their own directory!) and et voila all files batch cropped in the blink of an eye:teh resultNow, although this method is effective as you can see there are annoyances in the procedure! First locating the uncropped snaps, moving them to their own directory, determining offset & crop size, altering the script blah blah And i understand you wanting to get rid of dependencies and if you can do it, as i said before, i WILL worship you ^^ infact i'll even make a new sig with "I belong to the church of Adultery" in it!Oh and count me in on the beta, i have THOUSANDS of snaps that need to be created hehehe Quote
Adultery Posted December 8, 2011 Author Posted December 8, 2011 Honestly I could just have you select a bounding box and do a crop based on the dimensions of the box and do a batch crop if you'd be willing to pull out the ones that need to be cropped... No need for all the extra shazam when I could do most of what you described in the Paint class. Quote
DazzleHP Posted December 8, 2011 Posted December 8, 2011 Honestly I could just have you select a bounding box and do a crop based on the dimensions of the box and do a batch crop if you'd be willing to pull out the ones that need to be cropped... No need for all the extra shazam when I could do most of what you described in the Paint class. And THAT sir would be exactly why i'd chose your proggy over anything else - to be able to create snaps AND crop them all in one hit but yeah i was thinking of a bounding box type scenario when imagining it in my head, something like load the 1st snap in the folder, we then click the top-left (start of crop) then click bottom-right (end of crop) your proggy has all the info it needs and then boom! run command through all snaps in folder. i like it already even though it's only an idea at this stage lolAnd ofcourse i would (and i think most would in the circumstance) be willing to pull the offending snaps! I don't think anyone really expects a "One Button Hit" wonder proggy ^^ Anyone who does probably shouldn't be allowed on a computer But oooo i just had a spark, if the directory contained both cropped and uncropped images like the game gear set i mentioned (the already cropped were 160x144, and uncropped 320x200) maybe your prog could check if the image is already of cropped dimensions or smaller as set in your bounding box funtion and if so skip to next file.Sorry man i keep throwing ideas at you and you've only just started it lol i'll leave you to it Quote
Adultery Posted December 8, 2011 Author Posted December 8, 2011 No I thought about that too... like a compare attribute calc. Quote
Draco1962 Posted December 8, 2011 Posted December 8, 2011 To be honest, there are quite a few that expect a program to do everything for them, including their spouses. Sad but true. That is why I love being able to use plug-ins and modules so I can pick and choose which options I want rather than have a program that is so bloated trying to satisfy the masses that it becomes inefficient and inoperable - kinda like government. Quote
DazzleHP Posted December 9, 2011 Posted December 9, 2011 Exactly, obviously when my script encounters an image where it cannot possibly crop it using the defined dimensions ie image is too small then it returns an error and halts - good for catching them "uncropped" images that have actually been scaled down (probably using a batch command ironicaly!) and therefore useless - as ofcourse if you manually cropped a scaled down image that still has borders you'll probably end up with an image that is 56x50 or something worse?! But it can be real frustrating to "pull ALL the baddies", run the script only to have it halt repeatedly because of said scaled down images that look to me at a glance to be just uncropped!If you used a compare arguement then it would simply skip said offending files and continue batch command - right? Would save a helluva lot of hassle! Ofcourse i am only chucking these thoughts out there, last thing i wan't is for y'all to think "who dis dude comin in here shoutin shxt" lol not my attention at all it's just if i see potential in something and i have ideas i get on it i'm aware i am only a "noob" here EDIT: @ DracoTo be honest, there are quite a few that expect a program to do everything for them, including their spouses. i lol'd at this! Quote
Adultery Posted December 9, 2011 Author Posted December 9, 2011 Actually I'd probably have it move the file to an "unprocessed" folder and spit out the errors in a log. Quote
DazzleHP Posted December 9, 2011 Posted December 9, 2011 Good idea! That's why you're a coder and i'm an artist My imagination is too messed up to think rationally hehehe Quote
Adultery Posted December 9, 2011 Author Posted December 9, 2011 So how come I get to be both? Artist, coder, and musician. Think like all three = epic win! Quote
DazzleHP Posted December 9, 2011 Posted December 9, 2011 So how come I get to be both? Artist, coder, and musician. Think like all three = epic win!Good answer, actually dito ^^ guitarist? please don't coz i will freak lmao (actuallay not picked mine up in around 4 years - tragic yo) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.