Mildly Hurtful Sarcasm

Meaningless ranting, just like everybody else.

Friday, February 23, 2007

Quest for a nicer desktop IV - Fuzzy shadows

So my neighbor Vincent shelled out $200 for a video card so Aero would run on his Vista, and he still has nothing good to say about it. That's one big L on his forehead. I am going to make something as nice, for free. I almost have my shadows going but made the mistake of fading out black into white. What I really need is to let the black fade out. I need to implement per pixel transparency.

Per pixel transparency turned out to be easy. I don't call SetLayeredWindowAttributes() to specify opacity. Also, instead of handing WM_PAINT messages, I call UpdateLayeredWindow() to draw the shadow window once. Opacity is specified by the colors themselves - center color 50% opacity, edge color 0%.


INT num = 1;
CClientDC dcDst(wnd);
CDC dcMem;
dcMem.CreateCompatibleDC(&dcDst);
CBitmap bm;
bm.CreateCompatibleBitmap(&dcDst, nWidth, nHeight);
dcMem.SelectObject(&bm);
Graphics graphics(dcMem.GetSafeHdc());
Color clrSurround = Color(0x0, 0x0, 0x0, 0x0);
PathGradientBrush brShadow(&path);
brShadow.SetSurroundColors(&clrSurround, &num);
brShadow.SetCenterColor(Color(0x80, 0x0, 0x0, 0x0));
REAL xScale = (nWidth - nEdgeWidth * 2) / nWidth;
REAL yScale = (nHeight - nEdgeWidth * 2) / nHeight;
brShadow.SetFocusScales(xScale, yScale);
graphics.FillPath(&brShadow, &path);
UpdateLayeredWindow(
GetSafeHwnd(), dcDst.GetSafeHdc(),
0, 0, dcMem.GetSafeHdc(),
0, RGB(0, 0, 0), blendfunction,
ULW_ALPHA);
bm.DeleteObject();



There, a translucent window with a fuzzy shadow. Who says XP can't be cool looking.

Labels:

Tuesday, February 20, 2007

Kidney nut

This frigid, almost arctic condition outside only makes my snugly cozy fort of comfort all the more enticing. Patience is a proven age old virtue, so I'll relax and wait.

To be in a game so boring is undoubtedly torture. The players are soaked to the skin and move like frogs on the field under this record down pour. At the end, home team wins and champagne flows from the champion cup. While filing through the frustratingly long exit line I pass by the new addition to the stadium - some euro style foutain with water overflowing an artfully decorated bowl, and leaking through a conspicuously placed gap underneath.

Highway 1 is flooded so I have to take rutty State 29 which is now swamped with puddles. Off my exit I notice the sagging bulk on the town water tower is just a hairline fracture away from a disastrous burst. Sure enough a reason for me to speed home.

Home in couch position, I pick up my surf board - the clicker - and ready to let my new dish dazzle me with the gauranteed infinite variety of visual delights on the tube. Strangely though, as promising as a show like "The French Dames" has only a european engineer babbling about water sippage through some concrete cracks at a reservoir. So I decide to spend my afternoon power washing the driveway. Hosing off stuff gives me the high - not a girly squirt, no, a manly gush, splash! Finger on the trigger but pleasure so invigorating and liberating I inevitably feel guilty.

But why would I feel guilty anyway? And why is it so dark in here? Here is no driveway by the way. Oh... wait... I see... I should do it now... but it's so cold... but there's no way I can hold it till the morning... but it's so comfy here... but it's bad for the kidney... and after a little mental tug-o-war I realize I have no choice but to hop out of bed and hurry to the bathroom, cause I really need to pee.

Labels:

Wednesday, February 07, 2007

Skydome Airlines

A tall bearded Pete from the airline gave each of us a black Motorola beeper after we have passed through the pearl white metal detector. He said he would page us when the connecting flight was ready. That was weeks ago, I'm not sure how many.

We exited the terminal building and were desperate to find out where we were. It said City of Angels on a lamp post, so we assumed it was Los Angeles. We got on a shuttle and a chubby guy with a visor cap approached. Rather than collecting money he handed each of us a stack of paper. Mine was full of Greek alphabets. The next guy's spelled out some medical mysteries, heart failure etc.

We settled down at a retro classy hotel - stained glass dome ceiling, marble pillars and grand staircase, etc - looked like a joint Al Capone would have frequented. I spent the next few weeks in a room solving a pile of math problems, calculus, set theory, you name it. Our pagers never went off. Then we got anxious and took a hotel shuttle back to the airport.

So here we are at the ticket office talking about how we don't remember much about the last few weeks. Then somehow Skinny Gabe from kids school shows up behind the check-in counter. Unlike then he now looks radiant and glows. He instructs everybody to calm down and think back.

I remember our 767 was full so they upgraded me to first class. People by the windows were pointing and talking about a smoky engine. We were on our way to a emergency landing when a sudden jolt sent magazines and plastic cups flying all over. The low rumble of the turbines grew to a wailing roar, overshadowing the frantic screams of people trying hard to hold on to on their seats. The cabin shook violently and the cockpit door flapped open. Through the cockpit window I saw a control tower drew close rapidly at an angle. I was so scared and I closed my eyes and prayed.

Gabe finishes up his speech, something about how each of us has been given a talent and that he will watch over us. The machine underneath his desk has been spitting out boarding passes which he staples and hands us. I try to find the gate number on mine but in its place is a hospital name.

Oh boy, let's hope that my math will help make better planes in the future.

Labels: