Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Man I Love Writing Software…

Even when I’m not getting paid to do so...

I had a couple of hours last evening and decided to look into a problem a good friend asked me to help him solve.

He’s a photographer, and has a fairly extensive website that displays his work. Up until now he’s had to run each of his photos through a manual process to place a ‘Proof’ bar across the picture before posting it to his website.

The idea was, how can we, programmatically, run a series of pictures through a process to place a ‘proof-mark’ across the photo? Doing that allows the picture to be seen, and appreciated, yet prevents it from being taken and used elsewhere with out him being compensated for his efforts.

Well, truth be told he asked me to look into this many, many, months ago, and I’m sure he thought I’d either forgotten about it, or given up on writing something to address his need.

For whatever reason, last night I was thinking about all the other Windows API functions I’d been able to employ to handle FTP downloads both from the internet and from the Main Frame at the job, that I decided to look into the GDI portion of the API and see what I could come up with.

So, for a couple of hours I wrestled with the rather terse (to me) GDI documentation, and attempted to read, and rewrite a picture, then a picture with some text added, then added a ‘bar’, then placed the text in that bar.

Eventually I had an, admittedly incomplete, little application that will read an image file, create a semi-transparent rectangle and place some text inside the rectangle that’s fairly centered as well.

Now this might not seem like much to some of you, but I assure you I was close to dancing on the desk once I got this working.

If he thinks it will meet his needs, I'll tweak it just a bit to provide an interface and he’ll be able to specify a source and target directory and just click “Go” and have all the images in that directory ‘Proofed’ in one shot…

This is not rocket science, but it is definitely one of the things I love about writing software… being handed a problem and then finding a way to solve it.

The best part? That I did it in FoxPro of course… That language that no one seems to have an interest any more, but that continues to ‘come through’ in every situation I toss at it. It’s really a shame it doesn’t get the respect it deserves!

Here’s a sample of a before:



And the after:



Keep in mind folks, this is a language designed to manipulate databases, NOT images.

Again, it’s not software to cure a disease, or change the world, but a little (less than a couple of hundred lines of code) application that does exactly what I set out to do.

It’s also a little project I had a ton of fun wrestling with!!


Technorati Tags: Visual Foxpro - Images - Decisions - Software Development
-IceRocket Tags: Software Development - Decisions - Images - Visual FoxPro



This post first appeared on Code, Code World, please read the originial post: here

Share the post

Man I Love Writing Software…

×

Subscribe to Code, Code World

Get updates delivered right to your inbox!

Thank you for your subscription

×