如何将两副BMP或者JPG图象合成为一张GIF?(50分)

  • 主题发起人 主题发起人 wqhatnet
  • 开始时间 开始时间
W

wqhatnet

Unregistered / Unconfirmed
GUEST, unregistred user!
如何将两副BMP或者JPG图象合成为一张GIF?
 
看看这个或许对你有用
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2501669
 
baodinggirl
别捣乱!
 
用photoshop不就行了吗,很简单呀!
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2520304
 
jiguohua19 不用这样子吧
csdn开发高手04期中有一篇《实现渐变色与图像叠加效果》是c的,我看不太懂
你看的懂的话或许有用
 
你是在要程序中实现,还是找个工具?

网上有很多这种工具?
 
程序中实现
 
用GifImage就可以了,给gif的每一帧赋上指定的位图内容,JPG也转化为位图
 
[:(][:(][:(][:(][:(][:(][:(][:(][:(]
[:(][:(][:(][:(][:(][:(][:(][:(][:(]
[:(][:(][:(][:(][:(][:(][:(][:(][:(]
[:(][:(][:(][:(][:(][:(][:(][:(][:(]
[:(][:(][:(][:(][:(][:(][:(][:(][:(]
[:(][:(][:(][:(][:(][:(][:(][:(][:(]
[:(][:(][:(][:(][:(][:(][:(][:(][:(]
[:(][:(][:(][:(][:(][:(][:(][:(][:(]
 
怎么合并?是缩小了放在一起还是合成?
 
合成为动态的
 
请具体说一下,怎么动态,是图片交替播放,还是别的。如果是各自都是动态文件的话,放在个图片中,要先将每个图片在ACDSEE里取FRAME,然后在PHOTOSHOP里进行合成,最后用小软件合并成动态的。以上还原动态的过程也可以在ADOBE IMAGEREADY里完成。
 
那个我会
我要DELPHI代码实现
 
首先去下载gifimage.
下面给出合成四张图片为gif的代码
//uses gifimage

procedure TFormAnimate.ButtonAnimateClick(Sender: TObject);
var
GIF : TGIFImage;
i : integer;
OptimizeOptions : TGIFOptimizeOptions;
gr: TGraphic;
function TransparentIndex(GIF: TGIFSubImage): byte;
begin
// Use the lower left pixel as the transparent color
Result := GIF.Pixels[0, GIF.Height-1];
end;

function AddBitmap(GIF: TGIFImage; Source: TGraphic; Transparent: boolean): integer;
var
Ext : TGIFGraphicControlExtension;
LoopExt : TGIFAppExtNSLoop;
begin
// Preview the image being added (for user feedback)
// ImageAnimate.Picture.Assign(Source);
// ImageAnimate.Update;

// Add the source image to the animation
Result := GIF.Add(Source);
// Netscape Loop extension must be the first extension in the first frame!
if (Result = 0) then
begin
LoopExt := TGIFAppExtNSLoop.Create(GIF.Images[Result]);
LoopExt.Loops := 0; // Number of loops (0 = forever)
GIF.Images[Result].Extensions.Add(LoopExt);
end;
// Add Graphic Control Extension
Ext := TGIFGraphicControlExtension.Create(GIF.Images[Result]);
Ext.Delay := 30; // Animation delay (30 = 300 mS)
if (Transparent) then
begin
Ext.Transparent := True;
Ext.TransparentColorIndex := TransparentIndex(GIF.Images[Result]);
end;
GIF.Images[Result].Extensions.Add(Ext);
end;

begin
Screen.Cursor := crHourGlass;
try
GIF := TGIFImage.Create;
try
// Add all the images in the scroll box to the animation
for i := 0 to ScrollBoxSource.ControlCount-1 do
// Add frame
AddBitmap(GIF, // Destination GIF
TImage(ScrollBoxSource.Controls).Picture.Graphic, // Source bitmap
(i > 0)); // First frame is not transparent

// Optimize Color map...
{ if (CheckBoxPalette.Checked) then
GIF.OptimizeColorMap;

// Optimize GIF frames...
OptimizeOptions := [];
if (CheckBoxMerge.Checked) then
include(OptimizeOptions, ooMerge);
if (CheckBoxCrop.Checked) then
include(OptimizeOptions, ooCrop);
if (OptimizeOptions <> []) then
GIF.Optimize(OptimizeOptions, rmNone, dmNearest, 0);
}
// Display the animation
ImageAnimate.Picture.Assign(GIF);
image7.Picture.Assign(gif);
gr := TGIFImage.Create;//RV_CreateGraphics(TGraphicClass(image7.Picture.Graphic.ClassType));//gif.ClassType));
gr.Assign(gif.Bitmap );
// gr.Assign(image7.Picture.Graphic) ;
RichViewEdit1.InsertPicture('', gr , rvvaBaseLine);
finally
GIF.Free;
end;
ButtonSave.Enabled := True;
finally
Screen.Cursor := crDefault;
end;
end;

 
多人接受答案了。
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部