网上有代码,我试过,正确rocedure Picture3D(mBitmap3D, mBitmap2D, mBitmapMask:TBitmap;mLevelList:array of TRecordLevel); { 制作三维立体画 }// ~~~~~~~~~~~~~~~~空图片 ~~~~~~~~~~~2维图片 ~~~~~~~~~~背景var X,Y,I,J,W,H:Integer; vColor:TColor;begin mBitmap3D.Assign(nil); W:=mBitmapMask.Width; H:=mBitmapMask.Height; mBitmapMask.Height:=form1.Height; //for i:=1 to form1.height div H do mBitmapMask.Canvas.CopyRect(rect(0,i*H,W,i*H+H),mBitmapMask.Canvas,rect(0,0,W,H)); mBitmap3D.Width:=w*(mBitmap2D.Width div W); mBitmap3D.Height:=mBitmap2D.height; mBitmap3D.Canvas.Draw(0,0,mBitmapMask); form1.Edit1.text:=intToStr(mBitmap2D.Width div W); for I:=0 to (mBitmap2D.Width div W) do //整数个背景多次横向平铺. begin for Y:=0 to mBitmapMask.Height-1 do begin for X:=0 to W-1 do begin if (X+W*I>=mBitmap2D.Width) or (Y>mBitmap2D.Height) then continue; vColor:=mBitmap2D.Canvas.Pixels[X+W*I,Y]; //看样子mBitmap2D要有mBitmap3D的宽度才行!!!! for J:=Low(mLevelList) to High(mLevelList) do //各种高度扫描(不同的高度颜色不同,只有六个层次0-5) if (mLevelList[J].rColor=vColor) then begin if form1.checkbox1.Checked then //要求显著展示2D图 begin if vColor=clBlack then begin if X+mLevelList[J].rLevel>=W then mBitmapMask.Canvas.Pixels[X,Y]:=mBitmapMask.Canvas.Pixels[X+mLevelList[J].rLevel-W,Y] else mBitmapMask.Canvas.Pixels[X,Y]:=clwhite; Break; end; end else //正常显示3D图片 begin if X+mLevelList[J].rLevel>=W then mBitmapMask.Canvas.Pixels[X,Y]:=mBitmapMask.Canvas.Pixels[X+mLevelList[J].rLevel-W,Y] else mBitmapMask.Canvas.Pixels[X,Y]:={clwhite;//}mBitmapMask.Canvas.Pixels[X+mLevelList[J].rLevel,Y]; Break; end; end; end; end; mBitmap3D.Canvas.Draw(W*Succ(I),0,mBitmapMask); end;end; { Picture3D }