当前位置:主页>仓库管理软件> 列表

请教读取图像尺寸问题 找erp软件是什么意思

进销存软件版1楼: 请问:在windows目录中,点击到一个图像文件时,即刻显示出图像文件的尺寸和大小,
如何在delphi中得到这图像个文件尺寸?

2楼: 包含在图象文件的头文件信息中
tagBITMAPINFOHEADER = packed record
biSize: DWORD;//位图数据头的长度
biWidth: Longint;//图像宽
biHeight: Longint;//图像高
biPlanes: Word;
biBitCount: Word;
biCompression: DWORD;
biSizeImage: DWORD;
biXPelsPerMeter: Longint;
biYPelsPerMeter: Longint;
biClrUsed: DWORD;
biClrImportant: DWORD;
end;
TBitmapInfoHeader = tagBITMAPINFOHEADER; 如erp软件是什么意思

3楼: 楼上的朋友,您好
能给些代码吗?我是初学者!谢谢

4楼: type
TGIFHeader = packed record
Signature: array[0..2] of Char;
Version: array[0..2] of Char;
ScreenWidth: Word;
ScreenHeight: Word;
PackedFields,
BackgroundColorIndex,
AspectRatio: Byte;
end;


TGIFInfoHeader = TGIFHeader;
……
procedure Ttempphoto.AddMediaRec(out content_no, succed, errno,
errmsg: OleVariant; const PicName, Title, Author, Theme, PublishDate,
KeyWord: WideString; Length: SYSUINT; const Memo: WideString; PicHight,
PicWidth, Color_Pan: SYSUINT; content: OleVariant; PayNo: SYSINT;
const GroupNo: WideString);
//过程中部分相关的代码
var
p : pwidechar;
bb : string;
tempchar : integer;
mm : SYSUINT;
jpeg: TJPEGImage;
Gif:TGIFInfoHeader;
bmp:TBitmapInfoHeader;
phowidth: integer;
Phoheight: integer;
ss:TStringStream;
fileheader:TBitmapfileheader;
begin
……

p := Tvardata(content).volestr;
setlength(bb,Length);
mm := 1;
while mm<=Length do
begin
tempchar := integer(p[(mm-1) div 2]);
bb[mm]:= chr(tempchar mod 256);
if mm mm := mm+2;
end;
//读取图片的高和宽
ss:=tstringstream.Create(bb);
if ((PicName=''jpg'')or(PicName=''jpeg'')) then begin
jpeg:= TJPEGImage.Create;//需uses jpeg
jpeg.LoadFromStream(ss);
phowidth:=jpeg.width;
phoheight:=jpeg.height;
jpeg.free;
end
//根据自己定义的gif格式图片文件头信息读取图片的高和宽
else if (PicName=''gif'') then begin
ss.Read(gif,sizeof(gif));
phowidth:=gif.ScreenWidth;
phoheight:=gif.ScreenHeight;
end
//根据windows单元定义的bmp格式图片文件头信息读取图片的高和宽
else if (PicName=''bmp'') then begin
ss.Read(fileheader,sizeof(fileheader));
ss.Read(bmp,sizeof(bmp));
phowidth:=bmp.biWidth;
phoheight:=bmp.biHeight;
end
else begin
end;
ss.Free;
……
end;

5楼: 帮顶!

╭=========================================╮

80G海量源代码,控件,书籍全免费狂下不停!

http://www.source520.com

╰=========================================╯

6楼: 多人接受答案了。

进销存软件版7楼: 感谢各位的帮助