Lady in green

  • Post author:
  • Post category:琐事
  • Post comments:0评论

Lady in Green 是一款Wordpress主题,确切的来说,是我很喜欢的一款主题。不过,我对上面的页首的图片不感兴趣,换成了自己画的草灯立夏小朋友。这是我自己DIY的第一款Wordpress主题吧。很可惜的是,自己修改的主题在自己整理资料的时候删掉了,很是惋惜。
有趣的是,前几天在Google上搜索Iceyer的关键字,居然搜到很久以前我练习Wordpress使用的一个免费空间,而我的那款主题也正好在上面,于是我又找回了这款主题,呵呵。
那么,先来个预览吧……


Lady in Green(点击查看原始图像)

可惜的是,这款主题不支持Wordpress2.9。呜~~用不了。等自己php学好了,就去把那些不兼容的地方改过来:).

继续阅读Lady in green

走近WTL--GDI篇

WTL中的GDI类的封装与MFC不同,对于这些类的详细描述,可以参见WTL for MFC Programmers, Part IX – GDI Classes, Common Dialogs, and Utility Classes.
在由MFC的GDI向WTL的GDI转换过程中,有以下几个问题需要注意的:

一、OnPaint函数的处理。
在OnPaint函数的声明中,有以下的两种方法:

BEGIN_MSG_MAP_EX(MyWnd)
....
MESSAGE_HANDLER(WM_PAINT, OnPaint)
...
END_MSG_MAP()
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

或者是:

BEGIN_MSG_MAP_EX(MyWnd)
....
MSG_WM_PAINT(OnPaint)
...
END_MSG_MAP()
LRESULT OnPaint(HDC hdc)

实际上,这两种写法在使用中区别不大,第一种传入的四个参数都不会用到,第二种传入的hdc的值是NULL,所以这些参数都是不可以被OnPaint函数使用。那么在OnPaint中如何开始绘图呢?我们可以使用CPaintDC,如下:

LRESULT HexxagonWnd::OnPaint(HDC hdc)
{
    CPaintDC    pDC(m_hWnd);
    CDCHandle  dc(pDC.m_hDC);
...
}

这样,我们就可以方便的使用CDCHandle了。这篇文章也对这个问题做了一定的说明,大家可以参考一下:WTL7.0的一个BUG

二、如何创建双缓冲
在WTL中CDC类被CDCHandle取代,其中对CBitmap的一些操作也有了变化。

CRect lcrcClient;
GetClientRect(&lcrcClient);
CDCHandle MemDC; //首先定义一个显示设备对象
CBitmap MemBitmap;//定义一个位图对象
MemDC.CreateCompatibleDC(NULL);
MemBitmap.CreateCompatibleBitmap(dc,lcrcClient.Width(),lcrcClient.Height());
HBITMAP pOldBit=MemDC.SelectBitmap((HBITMAP)MemBitmap);

//使用MemDC绘制一些图像
....

dc.BitBlt(lcrcClient.left, lcrcClient.top,
    lcrcClient.Width(), lcrcClient.Height(),
    MemDC, lcrcClient.left, lcrcClient.top, SRCCOPY);

//绘图完成后的清理
MemBitmap.DeleteObject();
MemDC.DeleteDC();

三、SelectObject函数的变化
WTL的几个select函数都是直接使用对应类型的GDI对象,并且传入参数为HPEN、HBRUSH等类型,如下所示:

HPEN SelectPen(HPEN nPen)
HBRUSH SelectBrush(HBRUSH nBrush)
HFONT SelectFont(HFONT nFont)

一般的CPen等可以通过HPEN操作符直接从CPen转换出HPEN对象,所以保存、恢复GDI对象的代码要做如下改变:

CPen lcPen;
lcPen.CreatePen(PS_SOLID, 1, gColorGreen);
HPEN lcpOldPen = dc.SelectPen((HPEN)lcPen);

dc.SelectPen((HPEN)lcpOldPen);

当然,WTL的GDI与MFC还有一些其他的不同,大家使用时应注意。

继续阅读走近WTL--GDI篇

Komm,Susser Tod

Komm,Susser Tod
来吧甜蜜的死亡
歌词:庵野秀明
作曲/曲:Shiro SAGISU
主唱:ARIANNE
录音:铃木恭一

[anyplayer:type=mp3 id=tonglei url=https://dl.dropbox.com/u/45626013/iceyer.net/15_Komm_susser_Tod.mp3 open=yes]


I know, I know I’ve let you down
I’ve been a fool to myself
I thought that I could
live for no one else
But now through all the hurt and pain
It’s time for me to respect
the ones you love
mean more than anything
So with sadness in my heart
I feel the best thing I could do
is end it all
and leave forever
what’s done is done it feels so bad
what once was happy now is sad
I’ll never love again
my world is ending

I wish that I could turn back time
cos now the guilt is all mine
can’t live without
the trust from those you love
I know we can’t forget the past
you can’t forget love and pride
because of that, it’s kill in me inside

It all returns to nothing,
it all comes
tumbling down, tumbling down,
tumbling down

It all returns to nothing,
I just keep
letting me donw, letting me down,
letting me down

in my heart of hearts
I know that I called never love again
I’ve lost everything
everything
everything that matters to me
matters in this world

I wish that I could turn back time
cos now the guilt is all mine
can’t live without
the trust from those you love
I know we can’t forget the past
you can’t forget love and pride
because of that, it’s kill in me inside

It all returns to nothing,
it all comes
tumbling down, tumbling down,
tumbling down
It all returns to nothing,
I just keep
letting me donw, letting me down,
letting me down

It all returns to nothing,
it just keeps
tumbling down, tumbling down,
tumbling down

It all returns to nothing,
I just keep
letting me down, letting me down,
letting me down

继续阅读Komm,Susser Tod