An earlier post (Creating an AVI for ANIMATE_CLASS) described how to create an AVI that will work with the ANIMATE_CLASS common control. However, there are still some particulars that need to be ironed out for the AVI creation and play to be successful... especially when attempting to create an AVI from a GIF animated image.
Most of the issues center around bit depth and global palettes during the conversion. But, instead of explaining all this, I'll just give the basic steps used to create the AVI:
- Download ImageMagick
- At the command prompt use IM to create a series of frames with the proper encoding
Add the frame files (frame_00000.bmp)
Select the fps and press Begin
Choose a save name
Choose the "Microsoft RLE" compressor with quality set to 100
Press OK and verify the AVI can be played in Media Player
- convert -append spin.gif all.gif
- convert all.gif -unique-colors -depth 8 map.gif
- convert -coalesce spin.gif BMP2:frame_%05d.bmp
- mogrify -define bmp:format=bmp2 +matte -remap map.gif -colors 256 *.bmp
Also, keep in mind some colors may cause problems with transparency. So, be sure to remove ACS_TRANSPARENT from the window style if you don't want transparency.
Here is a Microsoft sample
for creating an AVI animation window (note: it uses ACS_TRANSPARENT).
I've spent far... far... too much time trying to get an AVI format that will actually work in the ANIMATE_CLASS common control. The usual tools were tried: ImageMagick, ffmpeg, and mplayer. But, nothing worked.
The windows API wouldn't complain about a bad format. It would just not display the AVI in the window.
So, after some digging, I realized I needed an RLE-8 compressed AVI. All the other tools would use an unsupported codec or they would produce a raw format codec that wouldn't be viewed in Windows Explorer or play in Windows Media Player.
After a bunch of trial and error, I came across MakeAVI. It's a super simple interface and gives you the choice of RLE compression or uncompressed video.
So, save your time and use MakeAVI when you want to mess around with archaic Win32 animation API's.
Update: Also see Creating an AVI from a GIF that works with ANIMATE_CLASS
It can be tricky setting your window as the top z-order window. It's not just a simple call to SetForegroundWindow.
Here's how to do it:
This solution is from Nish Sivakumar's code project article and KevinSW's comment.
Here are a series of maps of US counties showing various statistics (Religion, Mental Illness, Education, Income, etc...):
If I had the time and the data, I'd throw together a US county filter/screen app so people can browse and search the relative desirability of each county (like a stock filter).
First off, the term backslash for \ doesn't sit well. It would be best described as downslash since that is the direction the pen travels as it is written. But, for consistency, let's call it a backslash.
Maybe you have tried installing a Japanese keyboard and IME in Windows 7 and decided to uninstall it. You may notice after uninstalling everything (and doing the requisite restart) a yen symbols still replaces the backslash when typing the key.
In a command prompt (console), paths will look like:
To fix the problem, go to:
Settings (Control Panel) -> Region and Languages -> Administrative -> Language for non-Unicode programs -> Change system locale
You may have noticed that the setting was still set to Japanese. Make sure it is set back to English, whichever flavor that is.
Sparkle is an OSX framework used for automating software. Once integrated into an application it will pull an appcast to see if it a newer version is available. If a newer version exists, it will download and install it. This framework frees developers from having to roll out their own update mechanism that lives outside the App Store.
Built into Sparkle are little crumbs that make sure the update isn't performed too often since it will degrade the host application's performance. These preferences are saved in the host application's OSX preference/properties location.
When developing it is useful to be able to do an update check on every launch, which means clearing the crumbs Sparkle left behind. To do this use the "defaults" commandline tool:
$ defaults delete com.yourappdomainbundlename SUEnableAutomaticUpdates
$ defaults delete com.yourappdomainbundlename SULastCheckTime
If you want to see what else Sparkle puts in your application preferences, just read them:
$ defaults read com.yourappdomainbundlename
Xcode makes easy tasks hard. Want to view memory at a specific address? Well, don't look in the View menu, where most of the IDE panes are. Go to Product -> Debug -> View Memory.
Everyday using Xcode is like a scavenger hunt in Hades where the reward is absent and you can only ask yourself why you continue.
Say you have an application that makes a simple getenv() call to check an environment variable and you want to test it during runtime in the Xcode IDE debugger. How do you tell Xcode 4.6 to supply the environment variable?
It's hidden away in the schema. So, edit your schema and choose the "Run YourApp" item on the left panel. Then add an environment variable in the table to the right.
Working on any mildly complex project is a nightmare. Sure, Apple is all about minimalism, but those headers are descriptive and are useful when trying to describe solutions to project configurations. Scanning StackOverflow's Xcode questions reveal a funny but sad mix of "the left panel" or "the second-to-left panel."
The Xcode IDE is a dirty joke that makes the life of a developer worse. The time spent in Xcode config land versus actually being productive creating something is obscene.
After trying unsuccessfully to get a Japanese USB keyboard working on Windows 7, I found my Samsung Laptop keyboard and touchpad disabled. It appears Samsung uses special scan codes to enable/disable the touchpad and keyboard. The Japanese keyboard just happened to be able to issue one of those scan codes.
So, I inadvertently hit one of the keys and a "Hold: ON" message flashed on the screen. I didn't think anything of it until trying to type and move the cursor. Damn! I was stuck with the external keyboard and mouse until everything was backed out and fixed.
Restarting the laptop did nothing. Although the keyboard worked fine during bios/TrueCrypt authentication, it would revert back to being broken after booting the OS.
The Device Manager displayed for the Standard PS/2 Keyboard and the ELAN PS/2 Port Smart-Pad an error similar to the following:
Windows a driver for this device has been disabled. An alternate driver may be providing this functionality.
Uninstalling the keyboard driver and reinstalling it didn't seem to fix it, nor did powering everything down and using a paperclip to disconnect the battery.
What did work was disabling the keyboard and touchpad and re-enabling them. After a reboot, they were once again functioning.
• • •