svnno****@sourc*****
svnno****@sourc*****
2011年 8月 13日 (土) 18:11:06 JST
Revision: 4579 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4579 Author: yutakapon Date: 2011-08-13 18:11:06 +0900 (Sat, 13 Aug 2011) Log Message: ----------- Windows7 ã®æ°ããå£ç´è¨å®ã«å¯¾å¿ããã WallpaperStyle åä½ Fill 10 é«ããããã£ã±ãã«ãã(å·¦å³ããã¯ã¿åºã) Fit 6 å¹ ãããã£ã±ãã«ãã(ä¸ä¸ãã¯ã¿åºã) Modified Paths: -------------- trunk/teraterm/teraterm/vtdisp.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/vtdisp.c =================================================================== --- trunk/teraterm/teraterm/vtdisp.c 2011-08-13 08:26:34 UTC (rev 4578) +++ trunk/teraterm/teraterm/vtdisp.c 2011-08-13 09:11:06 UTC (rev 4579) @@ -632,6 +632,12 @@ else if(wi->pattern == 2) wi->pattern = BG_STRETCH; + else + if(wi->pattern == 10) + wi->pattern = BG_FIT_HEIGHT; + else + if(wi->pattern == 6) + wi->pattern = BG_FIT_WIDTH; //WXgL[ÌN[Y RegCloseKey(hKey); @@ -793,6 +799,7 @@ HBITMAP hbm; WallpaperInfo wi; OSVERSIONINFO osvi; + int s_width, s_height; BGGetWallpaperInfo(&wi); @@ -816,15 +823,41 @@ } } else { + BITMAP bm; + float ratio; + hbm = GetBitmapHandle(wi.filename); #ifdef DEBUG_XP - wi.pattern = BG_STRETCH; + //wi.pattern = BG_STRETCH; + //wi.pattern = BG_FIT_WIDTH; + //wi.pattern = BG_FIT_HEIGHT; #endif + + GetObject(hbm,sizeof(bm),&bm); + // ÇÌÝèÉí¹ÄAæÌXgb`TCYðßéB if (wi.pattern == BG_STRETCH) { - HBITMAP newhbm = CreateStretched32BppBitmapBilinear(hbm, CRTWidth, CRTHeight); + s_width = CRTWidth; + s_height = CRTHeight; + } else if (wi.pattern == BG_FIT_WIDTH) { + ratio = (float)CRTWidth / bm.bmWidth; + s_width = CRTWidth; + s_height = (int)(CRTHeight * ratio); + } else if (wi.pattern == BG_FIT_HEIGHT) { + ratio = (float)CRTHeight / bm.bmHeight; + s_width = (int)(CRTWidth * ratio); + s_height = CRTHeight; + } else { + s_width = 0; + s_height = 0; + } + + if (s_width && s_height) { + HBITMAP newhbm = CreateStretched32BppBitmapBilinear(hbm, s_width, s_height); DeleteObject(hbm); hbm = newhbm; + + wi.pattern = BG_STRETCH; } }