本帖最后由 jyswjjgdwtdtj 于 2023-6-5 20:33 编辑
重点:vector.add的类型一定是要long!每个变量都要clng!
 - set vector=createobject("wia.vector")
- for i=&h00 to &hff
- for j=&h00 to &hff
- vector.add 65280+i+256*256*j
- next
- next
- vector.ImageFile(256,256).savefile "1.jpg"
复制代码
 - set vector=createobject("wia.vector")
- c1=array(&hca,&h0c,&h9f)
- c2=array(&hff,&hd3,&h0c)
- r=c1(0)-c2(0)
- g=c1(1)-c2(1)
- b=c1(2)-c2(2)
- t=&hff
- for i=&h00 to t
- num=clng(c1(2)-i/(t+1)*b)+&h100*clng(c1(1)-i/(t+1)*g)+&h10000*clng(c1(0)-i/(t+1)*r)
- for aaaa=&h00 to &hff
- vector.add num
- next
- next
- vector.ImageFile(256,t+1).savefile "1.jpg"
复制代码
 - '嘿嘿 用一次函数和用错误排除浪费了性能 但是简单啊:lol
- set vector=createobject("wia.vector")
- c1=array(&hff,&h62,&h6e)
- c2=array(&hff,&hbe,&h71)
- r=c1(0)-c2(0)
- g=c1(1)-c2(1)
- b=c1(2)-c2(2)
- t=&hff
- l=&hff
- dim p()
- redim p(t,l)
- k=t/l'k为斜率
- function f(x,t)
- f=k*x+t
- end function
- call a
- function a
- on error resume next
- for i=-t to t't为截距
- num=clng(c1(2)-i/(t+1)*b)+&h100*clng(c1(1)-i/(t+1)*g)+&h10000*clng(c1(0)-i/(t+1)*r)
- for j=0 to l
- p(j,f(j,i))=num
- next
- next
- end function
- for i=0 to t
- for j=0 to l
- vector.add p(i,j)
- next
- next
- vector.ImageFile(l+1,t+1).savefile "1.jpg"
复制代码
|