Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory

Keywords: Match:
DIY digital picture frame runs Windows CE
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.
  1. 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!
  2. 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.
  3. 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)


Windows XP for Embedded Applications
This white paper describes the benefits of using Windows XP when developing embedded applications.

A Manager's Guide to Selecting a Mobile Device Operating System
This white paper offers a comparative review of Microsoft Windows CE and Windows Mobile.

Visual Basic 6.0 to .NET Migration
This paper focuses on the methodology and techniques which Infosys (Microsoft Technology Center) has developed for migrating VB 6.0 Applications to .NET. Our approach ensures a smooth, cost effective, and efficient migration.

Mobile Device Security: Securing the Handheld, Securing the Enterprise
This whitepaper identifies security threats to corporate data on mobile devices and details how mobile devices can become a "backdoor" to the enterprise.

Mobile Device Security: The Eight Areas of Risk
It's common knowledge that adding mobile devices to your network increases security risks. There are multiple facets to mobile security, all of which should be paid close attention to. This E-Guide presents a more in depth look into the eight key areas of securing wireless devices.

Quality Assurance and .NET
This paper discusses best practices for functional, regression and load testing of .NET applications.

SCADA Security in Integrated Networks
As businesses leverage their SCADA systems by integrating them into the business networks, they must also assure the security of the SCADA system.

The Advantages of Small Form Factor HMI
HMIs have mutated and changed with new requirements, and they have become more flexible and capable. And while they've been doing that, they've become smaller and more useful.

9 Critical Requirements for Web Application Security
Learn why your Web applications expose dangerous security breaches and what’s required to effectively protect your Web applications and the sensitive information behind them.

 


Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
Click here for a profile of each sponsor:
PLATINUM SPONSORS
(Become a sponsor)

ADVERTISEMENT
(Advertise here)

Updated! The latest Windows-powered...

mobile phones!

other cool
gadgets

HOT TOPICS
Microsoft targets PNDs with new embedded OS
Microsoft tips .NET MF 3.0 highlights
Microsoft previews Windows Embedded Standard
Microsoft offers free Windows CE 6.0 textbook
Microsoft renames embedded operating systems
Microsoft unveils Windows Mobile 6.1
New Atom models target low-cost PCs
REFERENCE GUIDES
Windows Device Showcase
Intro to Windows Embedded
Intro to Shared Source
Real-time Windows Embedded
Windows Embedded books
Join our Windows Embedded discussion forums:
Windows XP Embedded
Windows CE
Windows Mobile


Windows Embedded developer newsgroups
Windows CE
XP Embedded
PocketPC
Smartphone

Microsoft's Windows Embedded resources
Embedded dev center
Mobile dev center
Windows CE tutorials
XP Embedded tutorials
Windows Embedded seminars
Windows Embedded application categories
3rd-party partners


BREAKING NEWS

• Cortex-A8 SBCs target signage and kiosks
• Student competition offers a different kind of fireworks
• Windows CE SBC targets HMI development
• All-you-can-eat carrier launches -- sort of
• Adeneo and IntervalZero promote "soft-control" architecture
• App creates virtual serial ports in Windows CE
• Windows satellite phone service takes off (literally)
• Bsquare and Microsoft renew key distribution agreement
• Software syncs HTC phones with Macs
• Electricity meter runs Windows, talks to Google
• Windows device is two phones in one
• MIcrosoft's online store to debut with 600 Windows Mobile apps
• Windows Mobile gets upgraded Skype VoIP client
• Panel PC targets outdoor use
• Samsung shrinks ARM11 application processor


MOST POPULAR (last 90 days)
• "Netbook" uses Intel's Atom N270
• Windows CE takes on Linux in low-end netbooks
• HTC ups Touch resolution
• Microsoft unleashes new embedded OS
• Windows Mobile phone gets 800 x 480 display
• HTC spins WiMAX phone?
• Smart camera sports Atom
• Dual-core AMD netbook gets rave review
• Windows Mobile 7 "delayed"
• GPS phone uses new Marvell "Tavor" chip
MOST POPULAR (Classics from the vault)
Windows XP Embedded USB boot
Troubleshooting Windows XPe's blue screen "Stop 0x0000007B" error
Asus reveals $190 mini notebook
Windows Mobile 6 SDKs available for download
Windows Mobile VPN client plays with Cisco
HTC adds GPS to Windows Mobile Touch line
Microsoft unveils Windows Mobile 6.1
Guide to HTC's Windows Mobile smartphone platforms
• HTC releases Touch Diamond ROM upgrade
Customizing Windows XP Embedded thin clients

Also visit our sister sites:


Sign up for WindowsForDevices.com's...

news feed

Or, follow us on Twitter...



Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory  |  About  |  Contact
 

Ziff Davis Enterprise Home | Contact Us | Advertise | Link to Us | Reprints | Magazine Subscriptions | Newsletters
Tech RSS Feeds | White Papers | ROI Calculators | Tech Podcasts | Tech Video | VARs | Channel News

Baseline | Careers | Channel Insider | CIO Insight | DesktopLinux | DeviceForge | DevSource | eSeminars |
eWEEK | Enterprise Network Security | LinuxDevices | Linux Watch | Microsoft Watch | Mid-market | Networking | PDF Zone |
Publish | Security IT Hub | Strategic Partner | Web Buyer's Guide | Windows for Devices

Developer Shed | Dev Shed | ASP Free | Dev Articles | Dev Hardware | SEO Chat | Tutorialized | Scripts |
Code Walkers | Web Hosters | Dev Mechanic | Dev Archives | igrep

Use of this site is governed by our Terms of Service and Privacy Policy. Except where otherwise specified, the contents of this site are copyright © 1999-2008 Ziff Davis Enterprise Holdings Inc. All Rights Reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis Enterprise is prohibited. Windows is a trademark or registered trademark of Microsoft Corporation in the United States and/or other countries and is used by WindowsForDevices under license from owner. All other marks are the property of their respective owners. WindowsForDevices is an independent publication not affiliated with Microsoft Corporation.