哪位高手能帮忙改成VB ( 积分: 100 )

  • 主题发起人 主题发起人 huyinping781021
  • 开始时间 开始时间
H

huyinping781021

Unregistered / Unconfirmed
GUEST, unregistred user!
var x1,y1,x2,y2,x0,y0:integer;
x,y,dx,dy,nx,ny,i,j:integer;
r,g,b,tot,c:integer;
begin
image1.Picture.LoadFromFile('c:/tt1.bmp');
image2.width:=151*2;
image2.height:=151*2;
image2.Repaint;
Image2.Refresh;
x1:=image1.width;
y1:=image1.height;

x2:=151*2;
y2:=151*2;

dx:=0;
x0:=0;
for x:=0 to x2-2 do
begin
dy:=0;
y0:=0;
dx:=dx+x1;
nx:=0;
while dx>=x2 do
begin
inc(x0);
inc(nx);
dx:=dx-x2;
end;
for y:=0 to y2-2 do
begin
dy:=dy+y1;
ny:=0;
while dy>=y2 do
begin
inc(y0);
inc(ny);
dy:=dy-y2;
end;
r:=0; g:=0; b:=0;
tot:=0;
for i:=0 to nx do
for j:=0 to ny do
begin
c:=image1.Canvas.Pixels[x0-i,y0-j];
r:=r+(c shr 16);
g:=g+((c shr 8) and 255);
b:=b+(c and 255);
inc(tot);
end;

r:=r div tot;
g:=g div tot;
b:=b div tot;
c:=(r shl 16)+(g shl 8)+b;
image2.Canvas.Pixels[x,y]:=c;

end;
end;
 
用了VCL控件还转写成VB,你脑子有毛病?
 
我已修改完了
 
楼主兄弟 帮我也修改修改吧
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3686205
 

Similar threads

I
回复
0
查看
674
import
I
I
回复
0
查看
829
import
I
I
回复
0
查看
583
import
I
I
回复
0
查看
696
import
I
后退
顶部