关于图片处理的问题? ( 积分: 50 )

  • 主题发起人 主题发起人 gc1848
  • 开始时间 开始时间
G

gc1848

Unregistered / Unconfirmed
GUEST, unregistred user!
var
jpg: TJPEGImage;
bmp: TBitmap;
SourceJpg: TJPEGImage;
picturewidth,pictureheight,width1,height1:integer;
widthtimes,heighttimes,smalltimes:real;
begin
try
bmp := TBitmap.Create;
SourceJpg := TJPEGImage.Create;
Jpg:= TJPEGImage.Create;
//读取源文件
SourceJpg.LoadFromFile(SourceFileName);
//计算缩小比例
Width := SourceJpg.Width ;
height := SourceJpg.Height ;


为什么WIdth和height的最大值只能是1036*780
我用780*1036的图会变成780*780
2000*3000的图会变成的1036*780
1536*700的图会变成1036*700
 
var
jpg: TJPEGImage;
bmp: TBitmap;
SourceJpg: TJPEGImage;
picturewidth,pictureheight,width1,height1:integer;
widthtimes,heighttimes,smalltimes:real;
begin
try
bmp := TBitmap.Create;
SourceJpg := TJPEGImage.Create;
Jpg:= TJPEGImage.Create;
//读取源文件
SourceJpg.LoadFromFile(SourceFileName);
//计算缩小比例
Width := SourceJpg.Width ;
height := SourceJpg.Height ;


为什么WIdth和height的最大值只能是1036*780
我用780*1036的图会变成780*780
2000*3000的图会变成的1036*780
1536*700的图会变成1036*700
 
缩放吗?
bmp.Canvas.StretchDraw(Rect(0,0,宽度,高度),SourceJpg);
 
后退
顶部