M
mojialin100
Unregistered / Unconfirmed
GUEST, unregistred user!
我正在编写一个关于图形操作的程序,可以对图像进行一系列的操作,比如旋转,虑境得请哪位可以提供一个很好的例子!一个好的url下载地址也行啊!高分报答
堆积效果
procedure TForm1.N33Click(Sender: TObject);
var
newbmp: Tbitmap;
i, j, bmpheight, bmpwidth: integer;
begin
image1.Visible := true;
form1.Repaint;
newbmp := tbitmap.Create;
newbmp.Width := Image1.Width;
newbmp.Height := Image1.Height;
bmpheight := Image1.Height;
bmpwidth := Image1.Width;
i := bmpheight;
while i > 0 do
begin
for j := 10 to i do
begin
newbmp.Canvas.CopyRect(Rect(0, i - 20, bmpwidth, j),
image1.Canvas,
Rect(0, i - 20, bmpwidth, i));
Canvas.Draw(395, 109, newbmp);
end;
i := i - 20;
end;
newbmp.free;
end;
//**********************
百叶窗水平效果
procedure TForm1.N21Click(Sender: TObject);
var
newbmp: TBitmap;
i, j, bmpheight, bmpwidth: integer;
xgroup, xcount: integer;
begin
image1.Visible := true;
form1.Repaint;
image1.Visible := true;
form1.Repaint;
newbmp := TBitmap.Create;
newbmp.Width := image1.Width;
newbmp.Height := image1.Height;
bmpheight := image1.Height;
bmpwidth := image1.Width;
xgroup := 16;
xcount := bmpheight div xgroup;
for i := 0 to xcount do
for j := 0 to xgroup do
begin
newbmp.Canvas.CopyRect(Rect(0, xcount * j + i - 1, bmpwidth, xcount * j + i),
image1.Canvas,
Rect(0, xcount * j + i - 1, bmpwidth, xcount * j + i));
Canvas.Draw(395, 109, newbmp);
end;
newbmp.Free;
end;
//**********************
颜色翻转
procedure TForm1.N37Click(Sender: TObject);
begin
image1.Visible := true;
form1.Repaint;
paintbox1.Refresh();
hdc2 := paintbox1.Canvas.Handle;
hdc1 := image1.Canvas.Handle;
bitblt(hdc2, 0, 0, w, h, hdc1, 0, 0, notsrccopy);
end;
//**********************
浓雾效果
procedure TForm1.N36Click(Sender: TObject);
begin
image1.Visible := true;
form1.Repaint;
paintbox1.Refresh();
hdc2 := paintbox1.Canvas.Handle;
hdc1 := image1.Canvas.Handle;
bitblt(hdc2, 0, 0, w, h, hdc1, 0, 0, srcpaint);
end;
//**********************
流动效果
procedure TForm1.N34Click(Sender: TObject);
var
newbmp1: Tbitmap;
i1, j1, bmpheight1, bmpwidth1: integer;
begin
image1.Visible := true;
form1.Repaint;
newbmp1 := tbitmap.Create;
newbmp1.Width := Image1.Width;
newbmp1.Height := Image1.Height;
bmpheight1 := Image1.Height;
bmpwidth1 := Image1.Width;
for i1 := bmpheight1 downto 1 do
for j1 := 1 to i1 do
begin
newbmp1.Canvas.CopyRect(rect(0, j1 - 1, bmpwidth1, j1), image1.canvas, rect(0, i1 - 1, bmpwidth1, i1));
Canvas.Draw(395, 109, newbmp1);
end;
newbmp1.Free;
end;
[h1][/h1]