当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: class dobasefinalization { public static boolean flag = false; } class characteristic { string s; characteristic(string c) { s = c; system.out.println( "creating characteristic " + s); }......
    摘要: 要是改注册表的话,怎么才能将这些全部搜索到? ......


我的移位操作为什么得不到需要的结果呢请高手指教

我在做图像处理方面的工作,现在要把分开计算的r,g,b值保存成一个    
  Lontint型,因为我用的函数colortorgb将象素点值转换成longint值。    
  因此需要处理后保存成longint值。    
  ParanomicMatrix[x,y]:=   (tempArr[2]   shl   16)   and   (tempArr[1]   shl   8)    
                                                        and   tempArr[0]   ;    
  这里temparr是那个r,g,b数组,可是为什么我的赋值结果为0呢?导致图像变成了黑色的。请高手帮帮忙!

NO.1   作者: lyre

我没有做过图像处理,但从你的意图来看,似乎应该这样写:  
  ParanomicMatrix[x,y]:=   (tempArr[2]   shl   16)   or   (tempArr[1]   shl   8)    
                                                        or   tempArr[0]   ;    
 

NO.2   作者: surfguy

我不是很确定,提供两种参考意见:  
  1)rgb(0,0,0,)就是黑色,而且你的函数好像不对,应是shr不是shl.  
   
  2)ParanomicMatrix[x,y]:=   (tempArr[2]   shl   16)   or   (tempArr[1]   shl   8)    
                                                        or   tempArr[0]   ;

NO.3   作者: eulb

1,首先,你是按B-G-R(高到低)的顺序合成一个longint吗?  
  2,用and好像不对吧.  
  3,你的temparr数组是什么类型的?应该是DWORD吧?如果是byte按你的方法就不对了  
   
  那就试试这个  
  如果temparr是dword:  
  var  
      lint:Longint;  
   
  lint:=0;  
  lint:=(B   AND   $000000FF)   SHL   24;  
  LINT:=LINT   OR   ((G   AND   $000000FF)   SHL   16)   ;  
  LINT:=LINT   OR   (R   AND   $000000FF);  
  其中rgb分别对应你的数组相应颜色元素  
 


 ·快帮帮忙,紧100分    »显示摘要«
    摘要: 请帮我注明以下一段代码每一句的意思!!! 数据预处理vb代码 sub glz1() sheets("sheet1").select dim crstr as string j = 0 for i = 1 to 9000 if crstr <> sheet1.cells(i, 2).value then crstr = sheet1.cells(i, 2) j......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE