如何設定bmp解析度 |
尚未結案
|
morice
一般會員 發表:4 回覆:26 積分:16 註冊:2003-03-11 發送簡訊給我 |
#1
發表時間:2003-04-01 09:47:23
IP:61.221.xxx.xxx 未訂閱
請問各位高手,如何設定bitmap的解析度,以下的程式中biXPelsPerMeter是否為解析度設定??若是,為何不能回存???
procedure TForm1.Button1Click(Sender: TObject);
var
fileheader:TBitmapfileheader;
infoheader:TBitmapinfoheader;
s :TFilestream;
begin
s:=TFileStream.Create('try.bmp',fmOpenreadwrite);
s.Read(fileheader,sizeof(fileheader));
s.Read(infoheader,sizeof(infoheader));
//s.Free;
listbox1.Items.Clear;
listbox1.Items.Add('Filesize: ' inttostr(fileheader.bfSize));
listbox1.Items.Add('Width: ' inttostr(infoheader.biWidth));
listbox1.Items.Add('Height: ' inttostr(infoheader.biHeight));
listbox1.Items.Add('BitCount: ' inttostr(infoheader.biBitCount));
listbox1.Items.Add('Used: ' inttostr(infoheader.biClrUsed));
listbox1.Items.Add('x像素 ' inttostr(infoheader.biXPelsPerMeter));
listbox1.Items.Add('y像素 ' inttostr(infoheader.biYPelsPerMeter));
infoheader.biXPelsPerMeter:=4;
s.write(infoheader,sizeof(infoheader));
//s.w
s.free;
|
delphiwww
資深會員 發表:145 回覆:363 積分:368 註冊:2002-03-13 發送簡訊給我 |
#2
發表時間:2003-04-01 10:02:28
IP:202.145.xxx.xxx
未訂閱
你可以要去winapi區問看看
引言: 請問各位高手,如何設定bitmap的解析度,以下的程式中biXPelsPerMeter是否為解析度設定??若是,為何不能回存??? procedure TForm1.Button1Click(Sender: TObject); var fileheader:TBitmapfileheader; infoheader:TBitmapinfoheader; s :TFilestream; begin s:=TFileStream.Create('try.bmp',fmOpenreadwrite); s.Read(fileheader,sizeof(fileheader)); s.Read(infoheader,sizeof(infoheader)); //s.Free; listbox1.Items.Clear; listbox1.Items.Add('Filesize: ' inttostr(fileheader.bfSize)); listbox1.Items.Add('Width: ' inttostr(infoheader.biWidth)); listbox1.Items.Add('Height: ' inttostr(infoheader.biHeight)); listbox1.Items.Add('BitCount: ' inttostr(infoheader.biBitCount)); listbox1.Items.Add('Used: ' inttostr(infoheader.biClrUsed)); listbox1.Items.Add('x像素 ' inttostr(infoheader.biXPelsPerMeter)); listbox1.Items.Add('y像素 ' inttostr(infoheader.biYPelsPerMeter)); infoheader.biXPelsPerMeter:=4; s.write(infoheader,sizeof(infoheader)); //s.w s.free; |
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
#3
發表時間:2003-04-01 12:06:00
IP:147.8.xxx.xxx
未訂閱
引言: 請問各位高手,如何設定bitmap的解析度,以下的程式中biXPelsPerMeter是否為解析度設定??若是,為何不能回存??? procedure TForm1.Button1Click(Sender: TObject); var fileheader:TBitmapfileheader; infoheader:TBitmapinfoheader; s :TFilestream; begin s:=TFileStream.Create('try.bmp',fmOpenreadwrite); s.Read(fileheader,sizeof(fileheader)); s.Read(infoheader,sizeof(infoheader)); //s.Free; listbox1.Items.Clear; listbox1.Items.Add('Filesize: ' inttostr(fileheader.bfSize)); listbox1.Items.Add('Width: ' inttostr(infoheader.biWidth)); listbox1.Items.Add('Height: ' inttostr(infoheader.biHeight)); listbox1.Items.Add('BitCount: ' inttostr(infoheader.biBitCount)); listbox1.Items.Add('Used: ' inttostr(infoheader.biClrUsed)); listbox1.Items.Add('x像素 ' inttostr(infoheader.biXPelsPerMeter)); listbox1.Items.Add('y像素 ' inttostr(infoheader.biYPelsPerMeter)); infoheader.biXPelsPerMeter:=4; s.Seek(soFromCurrent,-Sizeof(infoheader)) s.write(infoheader,sizeof(infoheader)); //s.w s.free; |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |