by Jay Ongg (Jul. 22, 2004)
Foreword: Digital picture frames are becoming popular as demonstration projects for Windows CE. Recently, Microsoft's Mike Hall produced a video showing how to build one using Windows CE 5.0. In this article, based on excerpts from Jay Ongg's weblog, Jay explains how he built a digital picture frame using Windows CE 4.2 and an old laptop. Can't wait to have a picture frame in your living room that endlessly cycles through your favorite digital photos? Read on!
A do-it-yourself (DIY) Windows CE powered digital picture frame by Jay Ongg
I was inspired to create a digital picture frame after seeing the Junktop Revival Wiki as well as Mike Hall's project. I wanted to reuse one of my old laptops, a Thinkpad, but didn't want a hard drive -- too noisy. So out went XP, in came Windows CE.
Here are the features of the laptop digital picture frame:- no hard drive
- boots off a CDROM
- recognizes and reads random pictures off of a USB Mass Storage device, fired by a timer. Storage device is hot-swappable.
- no keyboard or mouse necessary for basic operation, but . . .
- two keyboard keys can increase or decrease the image display timer interval and . . .
- spacebar can jump to the next image
- after bootup, no more CDROM access is required. The whole Windows CE operating system is less than 10 MB, and fits neatly in ROM. (It can be cut down further if you look hard enough.)
The Application
The software is relatively straightforward. Upon startup, it maximizes to take up the full screen and gives it a black background. Then it polls every five seconds for files. The frequent polling is necessary because the USB storage device isn't ready immediately after the OS boots up. After the first time it reads the files, the timer interval goes to 60 seconds, which is adjustible by the keyboard.
For each tick of the timer, the program gets a list of the files in "\Hard Disk" (that's what Windows CE recognizes the USB mass storage device as) and displays a random image. That's pretty much it. If there's an error reading a file, the program just leaves the existing image up and waits for the next tick.
The image stretch logic is pretty simple -- the app gets the dimensions from the Bitmap object, and stretches the picturebox that the Bitmap is displayed into, such that the proportions are maintained while maximizing the real estate of the screen.
The Operating System
Using Windows CE's Platform Builder 4.2, I generated a custom Windows CE OS based on the Mobile Handheld design with a bunch of things taken out and .Net CF and USB support added. Ideally, I wanted PCMCIA support so then I could plug in a WiFi card, but I couldn't find a driver for the TI1225 PCMCIA chipset in the Dell Inspiron. (Note that I flipped back and forth between the Thinkpad and a Dell Inspiron for this project.)
Windows CE 4.2 and 5.0 both came with drivers for the TI1250 chipset, but not the 1225. I found a vendor online who offered a TI1225 driver, but they didn't seem to be interested in giving me a copy so I decided to forego it rather than write a driver for this project. So, USB became the preferred mass storage solution.
For the platforms, I added a CEPC and Emulator platform.
There were two custom modifications rquired: change the taskbar to be auto-hide and not on top; and launch my app (called "pictureframe.exe" for you creative types).
To set the taskbar state, I added these .reg keys to %_PROJECTOAKROOT%\files\project.reg [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell] ; If your browser doesn't display it, there is an 0x01 ASCII below
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\AutoHide] @="" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\OnTop] @="" I got these reg keys by manually setting them in the emulator, and using Platform Builder's remote registry editor to see what changed in HKLM\Software\Microsoft\Shell.
The second task, booting up my app, required adding this line to the project.bib file: pictureframe.exe pictureframe.exe NK S This includes the application in the image. Then I added these lines to project.reg to have the OS automatically boot up the app: [HKEY_LOCAL_MACHINE\init] ; @CESYSGEN IF CE_MODULES_SHELL "Launch99"="pictureframe.exe" "Depend99"=hex:32,00 The first value specifies that pictureframe.exe is to be launched, and the second line says to wait for Launch50 (hex 32) to be executed before launching pictureframe. Launch50 is explorer.exe (you can find this in shell.reg in the release directory).
That's pretty much it. The final step is:
CD Preparation
I took a standard CEPC boot floppy disk (there is none in the final version), and modified it so that it will mount the CD-ROM drive as drive R:, and execute: loadcepc /L:800x600x16 r:\nk.bin The image, created by Platform Builder, is nk.bin, and the /L flag is the resolution to run the OS at (the Thinkpad could only do 800x600, the Dell could do 1024x768). After creating the CEPC boot disk, I booted up Nero, selected CD-ROM (boot) as the CD type, and designated the floppy drive to be the source of the boot image. This turned out to be surprisingly complicated. I thought that Nero could just put a DOS boot sector on the CD, but it needs a source drive to copy it from. When you think about it, it kinda makes sense considering copyrights of DOS 6.22 and all that.
In the end, I had a usable Windows CE image with my software on it!
Hardware time!
Tools- Big flathead screwdriver (for use as a lever to open up the laptop case)
- Small flathead screwdriver (for use as a lever to open up the laptop case)
- Small Phillips screwdriver (to unscrew the laptop screws)
It took me about two hours end-to-end to take apart the Thinkpad. Later on, I took apart my Dell in a similar amount of time. So it's not that hard, you can do it too! Thankfully, Junktop Revival Wiki provides a lot of tips on where to concentrate your efforts, what to take apart, what not to, etc etc. Also, a feedback comment on the blog pointed out that IBM provides hardware manuals for their laptops as PDFs on their website. That would have been helpful.
I won't bore you with all the details, but suffice it to say that big screwdriver came in mighty handy. The end result is shown here, a bare LCD screen that can be mounted in a frame.
The Frame
The frame was, for me, the hardest part of this whole project. I discovered that I don't know how to cut 90 degree angles, even with a T-square!
The frame consists of: - Foamboard
- Black construction paper for matting
- A shadowbox to fit my laptop
I was able to cut the foamboard to fit into the shadowbox, and cut an opening for the LCD and laptop behind it. The foamboard is about the same thickness as the LCD, so it made a nice wedge. I could fit the LCD in there, and stick the rest of the laptop to it using duct tape or two-sided tape.
The next step was to cut the matting for the frame, at a minimum to hide all the circuitry and cut marks in the foamboard. I cut a few matts but each one had a problem . . . it didn't fit perfectly, or it wasn't at a 90 degree angle, or some other issue. So I repeatedly had to open up the frame, take out the laptop, take out the matting, and redo it.
At this point the tale takes a rather disturbing twist. In the process of removing the matting . . . ARGH! I dropped the laptop!!!!!!!!!!!!!!!
The laptop itself was OK, but the LCD backlight broke. That's how the Dell Inspiron came into the picture (so to speak). I ordered a new backlight for the Thinkpad on Ebay. In the meantime dismantled the Dell and recut the foamboard and matt to fit it. The end result is shown in the picture at the top of the article.
Future Directions
There are a number of things I'd like to do to enhance this picture frame. - Get a 2.5-inch IDE-to-CompactFlash adapter, and use it as a hard drive to boot the image. This gets rid of the CD-ROM and the last moving parts!
- Bluetooth support. Windows CE detected a Belkin USB Bluetooth Adapter I tried, so I know it will work with Bluetooth. I may upgrade to Windows CE 5.0 because it comes with a number of built-in profiles. The BlueTooth DUN profile allows connection to a LAN via a BlueTooth gateway to provide access and control of the picture frame from computers or PocketPCs from the network. I can add images, have the picture frame email images, etc.
- One of the things that I'd like to see (or know) -- since Windows XP and Windows CE both support NDIS drivers, would a driver that was written for Windows XP work on an x86 CE? Well it shouldn't, but maybe parts of it that don't rely on the Win32 API might. Just a thought . . . then there wouldn't be as much hassle in getting drivers for different hardware.
If you have any questions or comments, please email me. Enjoy!
About the author: Jay Ongg grew up in Long Island, NY. He received a B.S. and M.Eng in Computer Science from MIT, and moved out to Seattle for work. After working at Teledesic and Qpass, he joined Microsoft. Currently, he's a developer on the Partner Response Team in Mobile Devices. When he's not disassembling laptops in the interest of science, he enjoys swing dancing, volleyball, and reading voraciously.
The above article is reproduced by WindowsForDevices.com with the author's permission. Further details -- as well as the latest updates -- are available in Jay's full blog postings.
(Click here for further information)
|