如何将一个JPG文件分割成多个固定的文件,原JPG文件大概在2、300M,20000*20000,找了点资料,这样的图片应该需要分段读入和分区显示,不过不知道具体怎么实现,请高手告诉一下,如果解决问题,另送500分哈,谢谢了
解决方案 »
- 控件的访问权限怎样设置?
- copyrect 问题。。。。。。。。。。
- spcomm 组件的数据接收,如何做成基于过程接收而不是基于事件接收
- 两个小问题,多谢帮忙。
- 在sql里给ACCESS库自动建表,执行后表可建成,但报错"Microsoft JET数据库引擎找不到输入表或查询"t_milk",确定他是否存在"
- 难题:真正用过oracle和delphi组合编程的高手请进(关于lob字段的存取)
- 如何检测指定的目录下有多少个子目录(不涉及子目录)
- 那里能下载到Delphi在数据库方面的入门书籍!!
- 请教delphi高手,关于打印的问题。
- d7版的控件如何在delphi2010上安装?
- 投影问题!!很急……
- 如何用图片做窗体形状??
var Rect1,Rect2,Rect3:TRect;
bmp:TBitmap;
w,h:integer;
begin bmp:= TBitmap.Create;
bmp.Assign(Image1.Picture.Graphic);
w:=Image1.Width ;
h:=Image1.Height div 3;
Rect1:=Rect(0,0,w,h);
Rect2:=Rect(0,h,w,h*2);
Rect3:=Rect(0,h*2,w,h*3);
with Image2 do
begin
Height:=h;
Width:=w;
Canvas.CopyRect(Rect1,bmp.Canvas,Rect1);
end;
with Image3 do
begin
Height:=h;
Width:=w;
Canvas.CopyRect(Rect1,bmp.Canvas,Rect2);
end;
with Image4 do
begin
Height:=h;
Width:=w;
Canvas.CopyRect(Rect1,bmp.Canvas,Rect3);
end;
bmp.Free;
end;这是分成3个的,实现你的功能估计还需要自己加代码
可以将JPG对象装入BMP对象处理你的图像20000*20000,图像的尺寸不会太大吧,所以2、300M,写错了吧
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var Rect1,Rect2,Rect3:TRect;
bmp:TBitmap;
w,h:integer;
begin
bmp:= TBitmap.Create;
bmp.Assign(Image1.Picture.Graphic);
w:=Image1.Width ;
h:=Image1.Height div 3;
Rect1:=Rect(0,0,w,h);
Rect2:=Rect(0,h,w,h*2);
Rect3:=Rect(0,h*2,w,h*3);
with Image2 do
begin
Height:=h;
Width:=w;
Canvas.CopyRect(Rect1,bmp.Canvas,Rect1);
end;
with Image3 do
begin
Height:=h;
Width:=w;
Canvas.CopyRect(Rect1,bmp.Canvas,Rect2);
end;
with Image4 do
begin
Height:=h;
Width:=w;
Canvas.CopyRect(Rect1,bmp.Canvas,Rect3);
end;
bmp.Free;
end;end.已经将整个工程打包发到你的信箱[email protected]中了!
鉴于以上原因,11楼的代码,应该算是有问题的
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Jpeg;type
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
Image2: TImage;
Image3: TImage;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
JPGpic: TJpegImage;
Bmp: TBitmap;
y, h:integer;
begin
JPGpic := TJpegImage.Create();
JPGpic.LoadFromFile('D:\未命名.JPG');
Bmp := TBitmap.Create();
Bmp.Width := JPGpic.Width;
h := JPGpic.Height div 3;
Bmp.Height := h;
y := 0;
with Image1 do
begin
Height:=Bmp.Height;
Width:=Bmp.Width;
Bmp.Canvas.Draw(0, y, JPGpic);
Picture.Assign(Bmp);
end;
Dec(y, h);
with Image2 do
begin
Height:=Bmp.Height;
Width:=Bmp.Width;
Bmp.Canvas.Draw(0, y, JPGpic);
Picture.Assign(Bmp);
end;
Dec(y, h);
with Image3 do
begin
Height:=Bmp.Height;
Width:=Bmp.Width;
Bmp.Canvas.Draw(0, y, JPGpic);
Picture.Assign(Bmp);
end; Bmp.Free();
end;end.
cvSetImageROI( input, inputRect );
cvSetImageROI( output, outputRect );
cvResize( input, output ,CV_INTER_AREA);
可以直接装载到BMP上操作的,没搞清楚