線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:968
推到 Plurk!
推到 Facebook!

顯示問題

尚未結案
hjlin
一般會員


發表:63
回覆:48
積分:22
註冊:2003-02-11

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-08-04 10:01:45 IP:192.72.xxx.xxx 未訂閱
我原本在 1024*768 模式下開發我的程式,但轉到其他電腦 800*600 模式下後,我的 Bitmap 圖檔大小竟然還是維持 1024*768 時的大小,我要如何能讓 Bitmap 圖檔也能自動做變更的動作... 1024*768 ----> 800*600 ------------------------------------------ Image1(512*448) Image1(416*364) Bitmap1(256*224) Bitmap1(208*182) My program: (1024*768 模式下) Graphics::TBitmap *bmp_Im1 = new Graphics::TBitmap; bmp_Im1->LoadFromFile("Bitmap1.bmp"); // Bitmap1.bmp : 256*224 Image1->Picture->Bitmap->Assign(bmp_Im1); Image1->Width=bmp_Im1->Width*2; Image1->Height=bmp_Im1->Height*2;
brook
資深會員


發表:57
回覆:323
積分:371
註冊:2002-07-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-08-04 11:20:21 IP:218.160.xxx.xxx 未訂閱
試試 [/code] Image1->Picture->Bitmap->Canvas->CopyRect(TRect(0,0,Image1->Width,Image1->Height),bmp_Im1->Canvas,TRect(0,0,bmp_Im1->Width,bmp_Im1->Height)); [/code]
hjlin
一般會員


發表:63
回覆:48
積分:22
註冊:2003-02-11

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-08-04 13:11:48 IP:192.72.xxx.xxx 未訂閱
引言: 試試 [/code] Image1->Picture->Bitmap->Canvas->CopyRect(TRect(0,0,Image1->Width,Image1->Height),bmp_Im1->Canvas,TRect(0,0,bmp_Im1->Width,bmp_Im1->Height)); [/code]
我現在的問題是:在 1024*768 模式下的一張圖為512*448 但如果轉到 800*600 模式下後,此張圖還是為 512*448 要如何解決,我希望能隨著解析度不同而自動調整?
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-08-04 13:21:05 IP:61.218.xxx.xxx 未訂閱
Image1->Stretch=TRUE;
------
︿︿
hjlin
一般會員


發表:63
回覆:48
積分:22
註冊:2003-02-11

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-08-04 13:28:00 IP:192.72.xxx.xxx 未訂閱
引言: Image1->Stretch=TRUE;
試過了,好像沒啥差別說~
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-08-04 13:36:34 IP:61.218.xxx.xxx 未訂閱
Image1->Anchors Specifies how the control is anchored to its parent. property Anchors: TAnchors; Description Use Anchors to ensure that a control maintains its current position relative to an edge of its parent, even if the parent is resized. When its parent is resized, the control holds its position relative to the edges to which it is anchored. If a control is anchored to opposite edges of its parent, the control stretches when its parent is resized. For example, if a control has its Anchors property set to [akLeft,akRight], the control stretches when the width of its parent changes. Anchors is enforced only when the parent is resized. Thus, for example, if a control is anchored to opposite edges of a form at design time and the form is created in a maximized state, the control is not stretched because the form is not resized after the control is created. Note: If a control should maintain contact with three edges of its parent (hugging one side of the parent and stretching the length of that side), use the Align property instead. Unlike Anchors, Align allows controls to adjust to changes in the size of other aligned sibling controls as well as changes to the parents size.
------
︿︿
brook
資深會員


發表:57
回覆:323
積分:371
註冊:2002-07-12

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-08-04 14:01:55 IP:218.160.xxx.xxx 未訂閱
引言: 我現在的問題是:在 1024*768 模式下的一張圖為512*448 但如果轉到 800*600 模式下後,此張圖還是為 512*448 要如何解決,我希望能隨著解析度不同而自動調整?
一般的情況下不就是這樣嗎?就如同你的程式.
 
bmp_Im1->LoadFromFile("Bitmap1.bmp"); // Bitmap1.bmp : 256*224
Image1->Picture->Bitmap->Assign(bmp_Im1);
你的問題癥結所在是那個地方? 一般在1024*768和800*600的模式下,兩張相同的圖看起來就是大小不同. 要不然你你把 TImage 的 AutoSize 設成TRUE, 看是不是你所要的.
系統時間:2024-06-27 1:20:34
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!