旋轉的問題 |
尚未結案
|
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
DeviceMode.dmSize = SizeOf(TDeviceMode); DeviceMode.dmPelsWidth = Width; DeviceMode.dmPelsHeight = Height; DeviceMode.dmFields = DM_PELSWIDTH || DM_PELSHEIGHT; Result = ChangeDisplaySettings(DeviceMode,CDS_UPDATEREGISTRY);上面的code是我從Delphi翻過來的可是一直沒辨法過 ~我還在學習狀態希望多多向您學習~ 發表人 - taishyang 於 2004/02/26 17:08:29 |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
LONG ChangeDisplaySettings( LPDEVMODE lpDevMode, // graphics mode DWORD dwflags // graphics mode options ); lpDevMode [in] Pointer to a DEVMODE structure that describes the new graphics mode. If lpDevMode is NULL, all the values currently in the registry will be used for the display setting. Passing NULL for the lpDevMode parameter and 0 for the dwFlags parameter is the easiest way to return to the default mode after a dynamic mode change. The dmSize member of DEVMODE must be initialized to the size, in bytes, of the DEVMODE structure. The dmDriverExtra member of DEVMODE must be initialized to indicate the number of bytes of private driver data following the DEVMODE structure. In addition, you can use any or all of the following members of the DEVMODE structure. DEVMODE DeviceMode;我在lpDevMode裡填DeviceMode不對了嗎還是型態的問題呢 ~我還在學習狀態希望多多向您學習~ |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
上面的po我沒有分段sorry
lpDevMode[in] Pointer to a DEVMODE structure that describes the new graphics mode. If lpDevMode is NULL, all the values currently in the registry will be used for the display setting. Passing NULL for the lpDevMode parameter and 0 for the dwFlags parameter is the easiest way to return to the default mode after a dynamic mode change. The dmSize member of DEVMODE must be initialized to the size, in \bytes, of the DEVMODE structure. The dmDriverExtra member of DEVMODE must be initialized to indicate the number of bytes of private driver data following the DEVMODE structure. In addition, you can use any or all of the following members of the DEVMODE structure.~我還在學習狀態希望多多向您學習~ |
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
kraen4468 您好: 您要的是這個嗎? HDC hDCScreen = GetDC(NULL); int horres=GetDeviceCaps(hDCScreen,HORZRES); int vertres=GetDeviceCaps(hDCScreen,VERTRES); int freq=GetDeviceCaps(hDCScreen,VREFRESH); ReleaseDC(NULL, hDCScreen); horres=1024; vertres=768; DEVMODE dm; ZeroMemory(&dm, sizeof(DEVMODE)); dm.dmSize = sizeof(DEVMODE); dm.dmPelsWidth = horres; dm.dmPelsHeight = vertres; dm.dmDisplayFrequency = freq; dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY; ChangeDisplaySettings(&dm, 0); /*生活是一種藝術,用心生活才能享受生活*/ |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
引言: 可以Component可是沒有動作也 我把horres=800;vertres=600;也沒有變化 ~我還在學習狀態希望多多向您學習~您是要改變螢慕解析度嗎?參考這個範例試試吧! http://www.bytesandmore.de/rad/cpp/snipp/sc03020.php /*生活是一種藝術,用心生活才能享受生活*/發表人 - axsoft 於 2004/02/27 13:18:40 |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
引言: 可以在問你一個問題嗎? 我看了一回而結果裡面講的跟我一開始寫的都沒辨法搭上 可以幫我找我寫的這一段好嗎 還是初學者請多多指教 ~我還在學習狀態希望多多向您學習~老實說...您的發問...我到現在好還沒搞清楚您的需求...我只看到ChangeDisplaySettings() API其他真的不知你想問甚麼?< > 建議您發問時寫清楚需求....不然看的人真的在瞎子摸象....跌跌撞撞...< > 標題叫旋轉的問題?...是螢幕旋轉還是地球旋轉呀....搞不懂....] [>生活是一種藝術,用心生活才能享受生活>*/[/ |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
板主可以幫我看一下code嗎
這是delphi的程式
unit sw_resolution; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; function SetScreenResolution(Width, Height: integer): Longint; implementation {$R *.dfm} function SetScreenResolution(Width, Height: integer): Longint; var DeviceMode: TDeviceMode; begin with DeviceMode do begin dmSize := SizeOf(TDeviceMode); dmPelsWidth := Width; dmPelsHeight := Height; dmFields := DM_PELSWIDTH or DM_PELSHEIGHT; end; Result := ChangeDisplaySettings(DeviceMode, CDS_UPDATEREGISTRY); end; procedure TForm1.Button1Click(Sender: TObject); begin SetScreenResolution(800, 600); end; procedure TForm1.Button2Click(Sender: TObject); begin SetScreenResolution(1024, 768); end; end. 這是我轉成c 的程式 [code] //--------------------------------------------------------------------------- #include~我還在學習狀態希望多多向您學習~ |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
改成這樣吧!
也建議您把標題改成"如何改變螢幕解析度"
以下程式碼在Windows XP Professionl C Builder 6 Sp4 編譯測試OK //--------------------------------------------------------------------------- #include /*生活是一種藝術,用心生活才能享受生活*/發表人 - axsoft 於 2004/02/27 18:58:15 |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
引言: 對不起板主不是故意找查 我試了好多變還是不形 有什麼地方要特別注意的嗎 ~我還在學習狀態希望多多向您學習~請說明您的作業環境,Win9x/Me/NT系列作業系統我是沒試過... Windows2k/XP/2003應該可以很正常Work 這是我寫的範例,跟上面的Source Code是一樣的 http://delphi.ktop.com.tw/loadfile.php?TOPICID=14271561&CC=319179 您再試試吧! /*生活是一種藝術,用心生活才能享受生活*/ |
kraen4468
初階會員 發表:66 回覆:112 積分:35 註冊:2003-12-04 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |