delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks

#

怎样旋转矢量图形? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061113152916155.html
知道的话,能给发个实例程序(pyxyu@126.com),谢了!

矢量图形??你的矢量图形是如何实现的,想描述一个矢量图,大概有无数种具体实现吧。  
   
  如果不清楚他的实现,最笨的办法是先转换成位图,然后根据要旋转的法则逐个象素的复制移动,最后再转换回去。

谁知道,给我也发一份  
  email   :   lzd123@126.com  
  thank   you   !

gdi+轻松实现抗锯齿、缩放、旋转等功能

看看计算机图形学吧。  
  乘以一个矩阵就可以了。。

直接使用我们的产品吧!  
  TCAD  
  http://www.codeidea.com/cn/  
 

gdi

mark

posted @ 2008-11-05 09:40 delphi2007 阅读(280) | 评论 (0)编辑 收藏

在作为输出图形设备上,打印机和绘图仪有什么区别,用过绘图仪的朋友进 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061113152819156.html
我写的一个程序,在打印机上输出图形好好的,可到了绘图仪上就画不对了,请知道的朋友指点下
posted @ 2008-11-05 09:40 delphi2007 阅读(432) | 评论 (0)编辑 收藏

请教DBCHART功能实现问题。。。 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061113100118157.html
我查出来的表中有字段:fgroup,sl,je1,je2  
  FGROUP存的是小组名称,其他的都是数字字段。。。  
   
  想实现这样的功能:  
  |  
  |  
  |  
  |  
  |  
  |  
  |  
  |  
  ————————————————  
          je1             je2  
   
  横坐标是字段的量,纵坐标是数量。。。每个横坐标上显示各组的量,如A\B\C三组,有三个bar条。。  
  如何实现啊?我是想把每个组取出来然后分别显示在每个SERIES的data中?这样好像很麻烦。。  
   
  帮请教大家。。。

for   你的变量个数  
          Series1.addxy(x坐标值,   s1的值,   'X坐标显示的字符串',   clTeeColor);  
  for   你的变量个数  
          Series1.addxy(x坐标值,   je1的值,   'X坐标显示的字符串',   clTeeColor);  
  for   你的变量个数  
          Series1.addxy(x坐标值,   je2的值,   'X坐标显示的字符串',   clTeeColor);  
  for   你的变量个数  
          Series1.addxy(x坐标值,   je3的值,   'X坐标显示的字符串',   clTeeColor);

还是不明白?楼上的是说我要手工统计一下je1   je2的值,然后填上去吗?  
  比如我横坐标要显示三个组。。就是三组数据  
  每一组有je1和je2两个bar显示。。。  
   
  是按你那样的方法不?

没人帮忙一下啦?ffwin   的方式是用代码画出图形,能否用我上面说的数据库设置一下实现呢?

有没人帮忙一下呀   楼上的仁兄说的不能用呀:(

posted @ 2008-11-05 09:40 delphi2007 阅读(409) | 评论 (0)编辑 收藏

用Delphi编写一个简单的文本编辑器,怎样实现关键字高亮显示? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061111160809158.html
用Delphi编写一个简单的文本编辑器,怎样实现关键字高亮显示,以及下拉筐提示(类似于程序编辑器的自动完成功能).  
   
  1.   用什么样的控件,RichEdit可以么?   大体说下怎么实现?  
  2.   推荐一个控件,不要收费的,自己用不想花钱买控件.  
   
  谢谢高手!

RichEdit   应该可以  
  只是高亮的话可以自己实现.

RichEdit   如果有showhint属性的话   那就可以实现两者要求   不行就自己封装吧

直接用   TSynEdit   就可以了

posted @ 2008-11-05 09:40 delphi2007 阅读(818) | 评论 (0)编辑 收藏

请问如何制作中国象棋对弈软件的界面部分? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061111081529159.html
我有对弈程序的源代码,是用C++Builder编写的,但不知怎么制作界面?  
  哪位大侠能帮帮我?  
  无论是C++Builder版本或Delphi版本的都可以。  
  我的QQ:31726480  
  欢迎大家用QQ交流,甚至我提供源代码也行。  
 

好啊

我以前曾经改写了一下一个老外的源码,是个棋盘控件,delphi的,现在找不到我的源码了,但是估计那个老外的控件网上还能找到,顺便问一下,你那个对弈的源码下棋能达到什么水平啊?

水平比我差远了

我觉得算法比那个界面更重要   好的算法   好的流程那电脑就厉害   不然光出界面也没用

用TImage加上带透明的TBitmap之类的绘图不就行了。

对,界面容易做,画一下就可以,重要的是棋盘表示,是用数组,还是其他,棋子如何弄上去,如何移动棋子等。

我也寫過一個,棋盤是畫的線,背景用的圖片,棋子是自己做的圖,規則\動作都做好了,就是AI部份太差了,所以還是在電腦AI上多下功夫吧

关于这个问题,界面是最简单的,办法:  
  1、棋盘是一幅画,  
  2、定义2个数组,一个red[0..15],blk[0..15],表示棋子名称。  
  3、棋子也是图片,用透明特性显示园的。  
  4、移动时改变图片的位置,吃子将子移出棋盘并将visible   改为False;  
  关键是算法,围棋的死活、有无空我都做过function,但象棋的算法我没搞出,只能网络上两个真人对下,需求者与我联系EMAIL:qianzhidao@sohu.com  
  请有算法的发一个给我,以便一道完成这个程序。谢谢大家!

在Timage上画掰

关键是AI部分,博奕论的东东很复杂的。

我有那个老外的界面源代码,做得非常精美,是两个人联网对下的  
   
  就是缺少AI代码啊

我有个双人对战的代码.   写得很简陋.  
  http://www.ahjoe.com/z/ChessPrj.zip

http://www.dullwolf.cn/vml.asp

留下email

guanzhu  
 

直接重绘窗体,网上有五子棋的代码,你可以找来参考一下  
 

我也在写一个中国象棋组件,这是我写的界面,棋子背景没有做好:  
  http://www.xerp.cn/cc/bd.bmp  
   
  我写到判断炮的着法是否合法,炮的着法与车差不多,就是吃子的方式不一样,车的着法我倒写好了,但是炮的着法我写不出,有人知道吗?可否分享一下代码?  
  我的QQ:414695474

posted @ 2008-11-05 09:40 delphi2007 阅读(315) | 评论 (0)编辑 收藏

求助TCanvas内存无限涨的问题 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061110220830160.html
procedure   XXX;  
      var  
            Dc:   Hdc;  
            Mc:   TCanvas;  
  begin    
      Dc   :=   GetDc(0);  
      Mc   :=   TCanvas.Create;  
      try  
            Mc.Handle   :=   Dc;  
            {此部分用Mc画图...省略}  
      finally  
          Mc.Free;  
          ReleaseDC(0,   Dc)  
      end  
  end;  
   
  上面这段用TCanvas画图的程序,需要循环调用好多次(认为是无数次好了),但是我发现运行当中随着时间的增长...   内存也暴涨...   很快就暴了...  
   
  本人初学图形编程,头一次暴了以后,经过查阅资料,发现忘加了ReleaseDC及Mc.Free,便改正了  
   
  但是改正后的程序,仍然内存暴涨...   求助各位高手

另外,补充一下  
   
  这段程序是作为DLL,为其他程序所用的  
  所以每次都需要GetDc和TCanvas.Create  
   
  请高手对症下药...   怎样正确的释放内存

重复调用XXX时就重复创建Mc   :=   TCanvas.Create,而没有释放,所以内存无限上涨

就这几行代码你重复调用试试,还增长吗?  
  如果不增长,那就是你省略的代码的问题

应该是你省略掉的代码有问题   用AQTime查一下就知道了

ReleaseDC(0,   Dc)  
  是否有问题啊?  
   
  ---------------------  
  矢量组件   http://www.codeidea.com/cn/

posted @ 2008-11-05 09:37 delphi2007 阅读(502) | 评论 (0)编辑 收藏

Delphi中,如何读取资源文件? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061110215905161.html
Delphi中,如何读取资源文件?  
   
  我有个html文本,加载到当前的project中,那么在程序运行过程中,如何才能将这  
   
  个html文本的内容读取到一个String中?使用CreateFile、LoadFileStream等函数只能  
   
  读取硬盘中的文件。  
   
  另外,如何将一个可执行文件加载到project中,再在运行过程中,将这个可执行  
   
  文件读取出来?

自己顶一下!

用资源的方式。

就是不知道怎么弄啊。  
  怎么加载资源,怎么读取,能介绍介绍吗?  
 

一个简单的例子:  
  新建一个文本文档,随便添加些内容,命名为:index.htm  
  新建一个文本文档,添加以下内容:  
   
  CrnIndexHtml   RC_DATA   "index.htm"  
   
  然后保存为1.rc  
   
  把上面的1.rc添加到工程中,然后在窗体上放置一个Memo和一个Button,在Button的点击事件中:  
  procedure   TForm1.Button1Click(Sender:   TObject);  
  var  
          rs:   TResourceStream;  
  begin  
          rs   :=   TResourceStream.Create(HInstance,   'CrnIndexHtml',   'RC_DATA');  
          rs.Position   :=   0;  
          Memo1.Lines.LoadFromStream(rs);  
          rs.Free;  
  end;  
   
  编译,就可以看到效果。  
   
  以上代码实现的从资源中读取Htm资源,并将内容读取到Memo中。  
 

至于将可执行文件放到资源中,这样做:  
   
  准备一个exe文件,比如123.exe,放到工程目录下,编辑刚才的1.rc文件,添加一行:  
   
  CrnExeFile   RC_DATA   "123.exe"  
   
  然后在程序中:  
  procedure   TForm1.Button2Click(Sender:   TObject);  
  var  
          rs:   TResourceStream;  
  begin  
          rs   :=   TResourceStream.Create(HInstance,   'CrnExeFile',   'RC_DATA');  
          rs.SaveToFile('c:\ccrun\123.exe');  
          ShellExecute(Handle,   'Open',   'C:\ccrun\123.exe',   nil,   nil,   SW_SHOW);  
          rs.Free;  
  end;  
   
  实际应用中,可以将资源中的文件释放到某个比较隐蔽的目录中。  
   
 

楼主的分好多,老妖发达了~~~

收藏一下

如果不生成磁盘   文件就必须直接映射到内存运行..  
 

靠   老妖别把分全接走了啊     ~~

呵呵,谢谢,老妖解决了我的问题!  
  老妖高手啊,受教了!  
   
  宝剑赠烈士,红粉送佳人,老妖接分!  
  千金散尽还复来!

有机会,以后还要请教老妖!

不知vividw(vividw)所说的方法如何具体如何实现?

posted @ 2008-11-05 09:37 delphi2007 阅读(857) | 评论 (0)编辑 收藏

关于巷道标注的问题, 做过GIS的朋友请进 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061110114755162.html
我绘制了一条曲折的巷道(可以看成是一条不规则线),请问下怎样将这条巷道的名字  
  清晰的绘制在巷道上啊?

所有的字按照大致的走向呈直线分布,这样比较符合人的认知习惯

我也知道这么做   具体算法怎么实现啊

我猜想应该属于一个直线拟合问题。找到一条直线,使得相关点到这条直线的距离之和最短。相关的算法应该已经很成熟了,你自己搜索一下吧:P。只是这个也只能解决比较简单的问题,对于过于复杂的曲线估计很困难。

posted @ 2008-11-05 09:37 delphi2007 阅读(306) | 评论 (0)编辑 收藏

请教:用mediaplayer查wma的长度,timeformat设为tfmsf,tfframes,tfmilliseconds后,为什么得到的值都是一样的? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061109202822165.html
mp.TimeFormat:=tfMilliseconds;  
      mp.FileName:='c:\001.wma';  
      mp.Open;  
      showmessage(inttostr(mp.Length));  
   
      mp.TimeFormat:=tfMSF;  
      showmessage(inttostr(mp.Length));  
   
      mp.TimeFormat:=tfFrames;  
      showmessage(inttostr(mp.Length));  
   
  我用上述代码查001.wma的长度,同样一个文件,为什么得到同样的值呢?  
   
 
posted @ 2008-11-05 09:37 delphi2007 阅读(376) | 评论 (0)编辑 收藏

请问activemovie的用法?菜鸟问题 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061109180602166.html
写了一段播放视频的小程序?老师出错?  
     
  activemovie1.filename:='haha.mpg';  
  activemovie1.open;  
  activemovie1.play;  
   
  为什么不行呢?高手能不能给出详细的activemovie的用法?  
 
posted @ 2008-11-05 09:37 delphi2007 阅读(287) | 评论 (0)编辑 收藏

画“铁路线”的问题! Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061109144325167.html
最近在用delphi做一个小程序,要求画铁路线,线我能画出来,但是就是转折点的地方不能平滑。请高手指教一下,最好带点源码。

答案是有的。问一下您有没有用GDIPLUS单元?

没有用。跟这个有关系嘛?  
 

gdi有用

所有的图象处理的类都是继承GDIPLUS~

能不能给点实际一点的,这样讲的太泛了。

用mapx吧,delphi   +   mapx可以实现,而且很轻松

能不能改变画刷的角度的?因为我现在画斜线的时候这个图片还是原来的角度,我也想让他平行与画出来的线,旋转图片我试了一下,好像旋转后不太好,请问大家一下有没有刷子或者画笔改变角度的?  
 

其实看到楼主已经为这个事情开了好几个帖子了,其实问题很简单啊,为什么被你搞得这么复杂,不就是铁路线马?简单的铁路线就是2根长线,上边一堆小棍子,这个完全可以就用画直线和画曲线(圆,椭圆,最多Bezier)方法就解决了阿,这些都是现成的函数,无非多计算几个坐标点,有必要搞这么复杂吗?还非要Brush。  
  如果搂主的铁路不是图示(图示就是上边我说的),要画实际图,比如铁路图例很花,不是几个简单函数可以搞定,那么用Brush也可以理解,不过也不是很复杂啊,我想Brush画直线铁路你应该解决了,那剩下的就是拐弯了,这个问题你研究下有几种弯,那么就做几种弯的bitmap阿,一样brush   上去就行了,复杂点无非就是要多弄几个bitmap,不过要做的事情就这么多,没有那么多捷径的。

to   gogogo:  
      你说画铁路用两根线加小棍子我已经实现了,这个是好解决.现在我只是做的更加通用,用一个图片来做,以后我只要改变图片,就可以画另外的线条.brush画铁路能画出来,这个在水平和垂直的铁路线上一点问题没有,但是除了这两种之外的地方,铁路图片都需要旋转,世图片平行与我要画的线.就世旋转的过程中,我的图片有失真,而且两副图片不能紧靠在一起.gogogo,你高手再指点一下迷津吧.

你需要几种转弯,就预先做好几种bitmap作为brush阿,画的时候首先判断是什么弯,再调入什么brush阿,怎样使他们紧靠在一起,还不是你的bitmap和你计算的坐标问题。  
  比如画一个大曲率向右下的弯道,你向右的直线用10*10的brush画的直线铁路,比如铁路中的其中一条线路在brush中是0*3的位置,最后一次brush直线在整个图的100*100位置出现,那么我们计算你弯道brush出现的位置将是(100+10)*100=110*100的位置画右下弯道brush,这个brush由于大曲率,可能采用的brush可能就是20*20的bitmap,其中这个bitmap对应10*10中0*3那条线路位置的线路的位置在左上角的位置就应该是0*3,转弯后的位置应该是17*20,所以你把这个20*20的bitmap做好了,在110*100画上去就行了,过了弯道,下一个向下的直线铁路brush画(10*10)位置就应该是(110+20-10)*(100+20)=120*120的位置。这样表达估计比较难理解,最好边看,边画个图。

posted @ 2008-11-05 09:37 delphi2007 阅读(415) | 评论 (0)编辑 收藏

请问用Microsoft的VFW函数库怎样设置摄像头的速度? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061108214139168.html
如题,我用了CapCaptureSetSetup(capWnd,@CapParms,sizeof(TCAPTUREPARMS));  
  CapPreviewRate(capWnd,33)设置了速度好像都没有变化,都不能象摄像头自带的那个程序捕获的那么快?谢谢!

是回调函数的问题

请问可不可以详细说明一下,请指教!

http://xunway.com/gcom/wwwroot/zl/vfw1.htm  
  http://xunway.com/gcom/wwwroot/zl/vfw2.htm  
 

还是不行啊!可不可以给个例子啊?

还是别用vfw了,用三方控件,速度挺快的

DSPack才是正确的方法  
  VG也OK,不过不是开源的  
  VFW是最烂的

posted @ 2008-11-05 09:37 delphi2007 阅读(587) | 评论 (0)编辑 收藏

得到一个wma或mp3文件,如何用最简单的方法得到它的长度信息呢? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061108195617169.html
不需要知道歌手名专辑名等,只要长度即可,哪个指令可以做到呢?请给一点代码,万分感谢帮忙的兄弟!

uses   MMSystem;  
   
  var  
      OpenParms:   TMCI_Open_Parms;  
      StatusParm:   TMCI_Status_Parms;  
  begin  
      OpenParms.lpstrDeviceType   :=   '';  
      OpenParms.lpstrElementName   :=   'c:\1.mp3';  
      mciSendCommand(0,   MCI_OPEN   ,MCI_OPEN_ELEMENT,   Longint(@OpenParms));  
      StatusParm.dwItem   :=   mci_Status_Length;  
      mciSendCommand(OpenParms.wDeviceID,   MCI_STATUS,   MCI_STATUS_ITEM   ,   Longint(@StatusParm));  
      ShowMessage(IntToStr(StatusParm.dwReturn)+'毫秒');  
  end;

多谢这位仁兄,我看到有的地方说用mediaplayer的length属性也可以,不知哪个好些,而且如果mp3的采样率不是恒定的话,用这种方法可行吗?

汗,我是参考Mediaplayer的Length属性实现代码才写出上面那一段的,实质都是一样的方法。

posted @ 2008-11-05 09:37 delphi2007 阅读(490) | 评论 (0)编辑 收藏

怎么样画曲线? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061107162342170.html
已知A,B两点的坐标,我想画一条尽量直的曲线把这两点连接起来,不知道有什么函数可以实现。  
  如果能连接多点的更好。  
  大家帮忙想想办法,先谢谢了。。

两点不能画一条直线吗?  
 

画一条尽量直的曲线?  
  如果是直线则:  
  举例:  
  A(x1,y1),B(x2,y2)  
  //画直线  
  canvas.MoveTo(x1,y1);  
  canvas.linto(x2,y2);

还是画一条曲线,要不然无法描绘出轨迹,尽量直就是为了少走弯路。  
  大家提供几个两点间画曲线的函数可以吗?谢谢了   。。。

建议使用矢量图形组件TCAD  
  http://www.codeidea.com/cn/  
   
 

polyline

posted @ 2008-11-05 09:37 delphi2007 阅读(607) | 评论 (0)编辑 收藏

用CANVAS随着鼠标的移动画出矩形 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061107153346171.html
我想用CANVAS随着鼠标的移动,在窗体上画出一个从起点到终点的矩形框.我在MOUSEDOWN里记录起点,然后在MOUSEMOVE里从起点到鼠标所在位置画矩形,但是发现画了好多层的矩形,我现在只想从起点到鼠标所在位置画一个矩形,并且随着鼠标的移动而变化,该怎么做呢?如何擦除多余的矩形呢?

没人回答吗?

设定时器,如100ms  
  在OnTimer里执行画图操作,画矩形前清屏

unit   Unit1;  
   
  interface  
   
  uses  
      Windows,   Messages,   SysUtils,   Variants,   Classes,   Graphics,   Controls,   Forms,  
      Dialogs;  
   
  type  
      TForm1   =   class(TForm)  
          procedure   FormMouseDown(Sender:   TObject;   Button:   TMouseButton;  
              Shift:   TShiftState;   X,   Y:   Integer);  
          procedure   FormMouseMove(Sender:   TObject;   Shift:   TShiftState;   X,  
              Y:   Integer);  
      private  
          {   Private   declarations   }  
          FOpt,  
          FCpt:   TPoint;  
          procedure   DrawRectangle(AOpt,   ACpt:   TPoint);  
      public  
          {   Public   declarations   }  
      end;  
   
  var  
      Form1:   TForm1;  
   
  implementation  
   
  {$R   *.dfm}  
   
  procedure   TForm1.DrawRectangle(AOpt,   ACpt:   TPoint);  
  begin  
      With   Canvas   do  
      begin  
          //左垂  
          MoveTo(AOpt.X,   AOpt.Y);  
          LineTo(AOpt.X,   ACpt.Y);  
   
          //右垂  
          MoveTo(ACpt.X,   AOpt.Y);  
          LineTo(ACpt.X,   ACpt.Y);  
   
          //上水  
          MoveTo(AOpt.X,   AOpt.Y);  
          LineTo(ACpt.X,   AOpt.Y);  
   
          MoveTo(AOpt.X,   ACpt.Y);  
          LineTo(ACpt.X,   ACpt.Y);  
      end;  
  end;  
   
  procedure   TForm1.FormMouseDown(Sender:   TObject;   Button:   TMouseButton;  
      Shift:   TShiftState;   X,   Y:   Integer);  
  begin  
      With   Canvas   do  
      begin  
          if   Shift   =   [ssleft]   then  
          begin  
              Canvas.Pen.Mode   :=   pmNot;  
              Canvas.Pen.Color   :=   clRed;  
              FOpt   :=   Point(X,   Y);  
              FCpt   :=   Point(X,   Y);  
              MoveTo(X,   Y);  
              LineTo(X,   Y)  
          end;  
      end;  
  end;  
   
  procedure   TForm1.FormMouseMove(Sender:   TObject;   Shift:   TShiftState;   X,  
      Y:   Integer);  
  begin  
      With   Canvas   do  
      begin  
          if   Shift   =   [ssleft]   then  
          begin  
              DrawRectangle(FOpt,   FCpt);  
              FCpt   :=   Point(X,   Y);  
              DrawRectangle(FOpt,   FCpt);  
              exit;  
   
              MoveTo(FOpt.X,   FOpt.Y);  
              LineTo(FCpt.X,   FCpt.Y);  
              FCpt   :=   Point(X,   Y);  
              MoveTo(FOpt.X,   FOpt.Y);  
              LineTo(FCpt.X,   FCpt.Y)  
          end;  
      end;  
  end;  
   
  end.  
 

建议使用矢量图形组件TCAD  
  http://www.codeidea.com/cn/  
   
 

posted @ 2008-11-05 09:37 delphi2007 阅读(592) | 评论 (0)编辑 收藏

加解密多媒体文件 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061106153805172.html
procedure   FileXor(qFileName   :   String);       //加解密函数  
  var  
          fd   :   array[1..1024]   of   byte;  
          hf   :   integer;  
          br   :   Integer;  
          i   :   Integer;  
  begin  
          hf:=fileopen(qFileName,fmOpenReadWrite);  
        if   hf   <>   -1   then  
          begin  
                    FileSeek(hf,0,0);  
                    br   :=FileRead(hf,   fd,   1024);  
                    for   i   :=   1   to   br   do  
                    begin  
                          fd[i]   :=   (fd[i])   xor   (i   mod   $ff);  
                    end;  
                    FileSeek(hf,0,0);  
                    filewrite(hf,fd,   br);  
          end;  
          FileClose(hf);  
  end;  
  FORM的CREATE事件里:  
      filexor(‘c:\pin.mpg');           //解密MPG文件  
      mpp:=cvideo.Create(self);  //生成播放MPG控件  
      try   
            mpp.ReadFile(‘c:\pin.mpg',0);  
      finally  
          filexor(‘c:\pin.mpg');  //重新加密MPG文件  
      end;  
   
      mpp.free;  
   
  因为MPG文件正在被使用,所以后来想重新加密MPG文件不成功。只有在MPP.FREE后面再加密这个文件才可以。但我在程序中还需要用到这个录象文件,不能马上释放,如果不马上把这个文件加密,程序突然中断,我的录象就相当于没加密了,请问怎么解决。  
  一般的录象加密是怎么做的,程序中是怎么解密并运行的,能给个例子吗  
   
 

创建副本     加密好   覆盖掉原先的.                        
  录像   本身支持流   播放才能   以   流的方式解压.   播放.

posted @ 2008-11-05 09:37 delphi2007 阅读(306) | 评论 (0)编辑 收藏

录音时,显示即时播形图,求助 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061106094422173.html
我想在录音的时候,同时显示出对应的波形数据,我用的是waveinstart系列函数,但是最终生成的wave文件中,并没有声音,用千千静听播放时,全是杂音,而且千千静听显示的波形很怪。我用的是如下方法生成wave文件头的。  
  procedure   TRecorder.WriteHead;  
  var  
      fmtSize:   Integer;  
      fileSize:   DWORD;  
       
      wf   :   file   of   TWavHeader;  
      wh   :   TWavHeader;  
  begin  
      wh.rId   :=   $46464952;  
      wh.rLen   :=   36   +   m_SumData;  
      wh.wId   :=   $45564157;  
      wh.fId   :=   $20746d66;  
      wh.fLen   :=   16;  
      wh.wFormatTag   :=   1;  
      wh.nChannels   :=   m_WaveFormat.nChannels;  
      wh.nSamplesPerSec   :=   m_WaveFormat.nSamplesPerSec;  
      wh.nAvgBytesPerSec   :=   m_WaveFormat.nAvgBytesPerSec;  
      wh.nBlockAlign   :=   m_WaveFormat.nBlockAlign;  
      wh.wBitsPerSample   :=   m_WaveFormat.wBitsPerSample;  
      wh.dId   :=   $61746164;  
      wh.wSampleLength   :=   m_SumData;  
   
      FileStream.Write(wh,   SizeOf(wh));  
  end;  
   
  其他代码即如下:  
   
   
   
   
  constructor   TRecorder.Create(wBitsPerSample,   wChannels:   Word;  
      dwSampleRate:   Cardinal;   nBufferLength:   Integer);  
  var  
      i:   Integer;  
  begin  
  m_bRecording   :=   FALSE;  
  m_bDeviceOpen   :=   FALSE;  
  m_PcmFormat.wBitsPerSample   :=   wBitsPerSample;  
  m_PcmFormat.wChannels   :=   wChannels;  
  m_PcmFormat.dwSampleRate   :=   dwSampleRate;  
  m_dwBufferSize   :=   (nBufferLength   *   (m_PcmFormat.wChannels)   *   (m_PcmFormat.wBitsPerSample)   div   8);  
  fnProcessBuffer   :=   nil;  
  m_lpWaveHdr   :=   nil;  
      m_SumData   :=   0;  
  m_hEvent   :=   0;  
  m_hThread   :=   0;  
      for   i:=   0   to   MAXNUMOFBUFFER   -   1   do  
  begin  
  m_hWaveInHdr[i]   :=   0;  
  m_hInBuffer[i]   :=   0;  
  end;  
  end;  
   
  constructor   TRecorder.Create(nBufferLength:   Integer);  
  var  
      i:   Integer;  
  begin  
      m_bRecording   :=   False;  
      m_bDeviceOpen   :=   False;  
      m_PcmFormat.wBitsPerSample   :=   16;  
      m_PcmFormat.wChannels   :=   2;  
      m_PcmFormat.dwSampleRate   :=   11025;  
      m_dwBufferSize   :=   (nBufferLength   *   m_PcmFormat.wChannels   *   m_PcmFormat.wBitsPerSample   div   8);  
  fnProcessBuffer   :=   nil;  
  m_lpWaveHdr   :=   nil;  
   
  m_hEvent   :=   0;  
  m_hThread   :=   0;  
      for   i:=   0   to   MAXNUMOFBUFFER   -   1   do  
  begin  
  m_hWaveInHdr[i]   :=   0;  
  m_hInBuffer[i]   :=   0;  
  end;  
  end;  
   
  constructor   TRecorder.Create(pcm:   TPCMFormat;   nBufferLength:   Integer);  
  var  
      i:   Integer;  
  begin  
  m_bRecording   :=   FALSE;  
  m_bDeviceOpen   :=   FALSE;  
  m_PcmFormat.wBitsPerSample   :=   pcm.wBitsPerSample;  
  m_PcmFormat.wChannels   :=   pcm.wChannels;  
  m_PcmFormat.dwSampleRate   :=   pcm.dwSampleRate;  
  m_dwBufferSize   :=   (nBufferLength   *   m_PcmFormat.wChannels   *   m_PcmFormat.wBitsPerSample   div   8);  
  fnProcessBuffer   :=   nil;  
  m_lpWaveHdr   :=   nil;  
   
  m_hEvent   :=   0;  
  m_hThread   :=   0;  
      for   i:=   0   to   MAXNUMOFBUFFER   -   1   do  
      begin  
  m_hWaveInHdr[i]   :=   0;  
  m_hInBuffer[i]   :=   0;  
      end;  
   
  end;  
   
   
  function   TRecorder.GetPosition:   Int64;  
  var  
      mmtime:   TMMTime;  
  begin  
      if   m_hWaveIn   <>   0   then  
      begin  
          mmtime.wType   :=   TIME_SAMPLES;  
          if   waveInGetPosition(m_hWaveIn,   @mmTime,   SizeOf(mmTime))   <>   MMSYSERR_NOERROR   then  
              Result   :=   -1  
          else  
              Result   :=   mmTime.sample;  
      end;  
      Result   :=   -1;  
  end;  
   
  function   TRecorder.IsDeviceOpen:   Boolean;  
  begin  
      Result   :=   m_bDeviceOpen;  
  end;  
   
  function   TRecorder.IsFormatSupported(wfEX:   tWAVEFORMATEX;  
      nDev:   Cardinal):   Boolean;  
  var  
      mm:   MMRESULT;  
  begin  
      mm   :=   waveInOpen(nil,   nDev,   @wfEx,   0,   0,   WAVE_FORMAT_QUERY);  
      if   mm   =   MMSYSERR_NOERROR   then  
          Result   :=   True  
      else  
          Result   :=   False;  
  end;  
   
  function   TRecorder.IsRecording:   Boolean;  
  begin  
      Result   :=   m_bRecording;  
  end;  
   
  procedure   TRecorder.Open(dwCallBack,   dwCallbackType:   Cardinal;  
      wMCIDeviceID:   MCIDEVICEID);  
  var  
      i:   Integer;  
  begin  
      if   not   m_bDeviceOpen   then  
      begin  
          if   dwCallBack   =   0   then  
              dwCallBack   :=   DWord(@waveinProc);  
   
          for   i:=   0   to   MAXNUMOFBUFFER   -   1   do  
          begin  
              m_hWaveInHdr[i]   :=   GlobalAlloc(GHND   or   GMEM_SHARE,   SizeOf(TWaveHdr));  
              m_lpWaveInHdr[i]   :=   pWaveHdr(GlobalLock(m_hWaveInHdr[i]));  
              m_hInBuffer[i]   :=   GlobalAlloc(GHND   or   GMEM_SHARE   ,   m_dwBufferSize);  
              m_lpInBuffer[i]   :=   PBYTE(GlobalLock(m_hInBuffer[i]));  
              m_lpWaveInHdr[i]^.lpData   :=   PChar(m_lpInBuffer[i]);  
              m_lpWaveInHdr[i]^.dwBufferLength   :=   m_dwBufferSize;  
              m_lpWaveInHdr[i]^.dwBytesRecorded   :=   0;  
              m_lpWaveInHdr[i]^.dwUser   :=   Cardinal(Pointer(Self));  
              m_lpWaveInHdr[i]^.dwFlags   :=   0;  
              m_lpWaveInHdr[i]^.dwLoops   :=   1;  
              m_lpWaveInHdr[i]^.lpNext   :=   nil;  
              m_lpWaveInHdr[i]^.reserved   :=   0;  
          end;  
   
          m_WaveFormat.wFormatTag   :=   WAVE_FORMAT_PCM;  
          m_WaveFormat.nChannels   :=   m_PcmFormat.wChannels;  
          m_WaveFormat.wBitsPerSample   :=   m_PcmFormat.wBitsPerSample;  
          m_WaveFormat.nSamplesPerSec   :=   m_PcmFormat.dwSampleRate;  
          m_WaveFormat.nBlockAlign   :=   m_WaveFormat.nChannels   *   m_WaveFormat.wBitsPerSample   div   8;  
          m_WaveFormat.nAvgBytesPerSec   :=   m_WaveFormat.nBlockAlign   *   m_WaveFormat.nSamplesPerSec;  
          m_waveClass.lpData   :=   Self;  
   
          if   not   ((waveInOpen(PHWAVEIN(@m_waveClass),   wMCIDeviceID,   PWaveFormatEx(@m_WaveFormat),  
                                              dwCallBack,   0,   dwCallbackType)   <>   0)   or  
                        (m_waveClass.hWave   =   0)  
                        )   then  
          begin  
              m_waveClass.lpData   :=   Self;  
              m_hWaveIn   :=   HWAVEIN(m_waveClass.hWave);  
              m_hEvent   :=   CreateEvent(nil,   False,   False,   nil);  
              m_bDeviceOpen   :=   True;  
          end;  
      end;  
  end;  
   
  function   TRecorder.Pause:   Boolean;  
  begin  
      Result   :=   False;  
      if   m_hWaveIn   <>   0   then  
      begin  
          if   waveInStop(m_hWaveIn)   =   MMSYSERR_NOERROR   then  
          begin  
              m_bRecording   :=   False;  
              Result   :=   True;  
          end;  
      end;  
  end;  
   
  procedure   TRecorder.ProcessNextBuffer(pwh:   PWaveHdr);  
  begin  
      if   @fnProcessBuffer   <>   nil   then  
          fnProcessBuffer(m_lpData,pwh);  
      m_SumData   :=   m_SumData   +   2048   -1;  
  waveInUnprepareHeader(m_hWaveIn,   pwh,   sizeof(WAVEHDR));  
  waveInPrepareHeader   (m_hWaveIn,   pwh,   sizeof(WAVEHDR));  
  waveInAddBuffer(m_hWaveIn,   pwh,   sizeof(WAVEHDR));  
  end;  
   
  procedure   TRecorder.SetBufferFunction(lpData:   Pointer;  
      fnProcess:   ProcessBuffer);  
  begin  
      m_lpData   :=   lpData;  
      fnProcessBuffer   :=   fnProcess;  
  end;  
   
  procedure   TRecorder.SetFormat(lpPcmFormat:   pPCMFormat);  
  begin  
      if   m_bDeviceOpen   =   False   then  
      begin  
          m_PcmFormat.wBitsPerSample   :=   lpPcmFormat^.wBitsPerSample;  
          m_PcmFormat.wChannels   :=   lpPcmFormat^.wChannels;  
          m_PcmFormat.dwSampleRate   :=   lpPcmFormat^.dwSampleRate;  
      end;  
  end;  
   
  procedure   TRecorder.SetFormat(wBitsPerSample,   wChannels:   Word;  
      dwSampleRate:   Cardinal);  
  begin  
  if   m_bDeviceOpen   =   False   then  
      begin  
          m_PcmFormat.wBitsPerSample   :=   wBitsPerSample;  
          m_PcmFormat.wChannels   :=   wChannels;  
          m_PcmFormat.dwSampleRate   :=   dwSampleRate;  
      end;  
  end;  
   
  procedure   TRecorder.Start;  
  var  
      i:   Integer;  
      ThreadId:   DWORD;  
  begin  
      if   not   m_bDeviceOpen     then  
          Exit  
      else  
      begin  
          for   i:=   0   to   MAXNUMOFBUFFER   -   1   do  
          begin  
              if   waveInPrepareHeader(m_hWaveIn,   m_lpWaveInHdr[i],   SizeOf(TWaveHdr))   <>   MMSYSERR_NOERROR   then  
                  Exit;  
              if   waveInAddBuffer(m_hWaveIn,   m_lpWaveInHdr[i],   SizeOf(TWaveHdr))   <>   MMSYSERR_NOERROR   then  
                  Exit;  
          end;  
          FileStream   :=   TFileStream.Create('c:\wave.wav',   fmCreate   or   fmOpenReadWrite   );  
          WriteHead;  
          //begin   sampling  
          m_bRecording   :=   True;  
          m_hThread   :=   CreateThread(nil,   0,   @RecorderThreadFunc,   Self,   0,   ThreadId);  
          waveInStart(m_hWaveIn);  
          if   m_hThread   <>   0   then  
          begin  
              SetPriorityClass(m_hThread,   REALTIME_PRIORITY_CLASS);  
              SetThreadPriority(m_hThread,   THREAD_PRIORITY_HIGHEST);  
          end;  
      end;  
  end;  
   
  procedure   TRecorder.Stop;  
  begin  
      if   (m_bDeviceOpen   =   False)   or   (m_bRecording   =   False)   then  
          Exit;  
      if   (waveInStop(m_hWaveIn))   <>   MMSYSERR_NOERROR   then  
          Exit  
      else  
          m_bRecording   :=   False;  
  end;  
   
   
   
   
  求高手与熟手指点下啊。如果哪位有代码请帮下俺啊。在线等,很急。  
 

剩下的代码:  
  procedure   TRecorder.Close;  
  var  
      i:   Integer;  
  begin  
      FileStream.Position   :=   0;     //重定位  
      WriteHead;  
      if   m_bRecording   then  
          Stop;  
      if   m_hThread   <>   0   then  
          CloseHandle(m_hThread);  
      if   m_bDeviceOpen   then  
          waveInClose(m_hWaveIn);  
   
      for   i:=   0   to   MAXNUMOFBUFFER-1   do  
      begin  
          if   (m_hWaveInHdr[i]   <>   0   )   then  
          begin  
              if   GlobalUnlock(m_hWaveInHdr[i])   then  
                  GlobalFree(m_hWaveInHdr[i]);  
              if   GlobalUnlock(m_hInBuffer[i])   then  
                  GlobalFree(m_hInBuffer[i]);  
              m_hWaveInHdr[i]   :=   0;  
              m_hInBuffer[i]   :=   0;  
          end;  
      end;  
   
      m_bDeviceOpen   :=   False;  
      m_bRecording   :=   False;  
      m_hThread   :=   0;  
  end;  
   
  function   TRecorder.Continue:   Boolean;  
  begin  
      Result   :=   False;  
      if   m_hWaveIn   <>   0   then  
      begin  
          if   waveInStart(m_hWaveIn)   =   MMSYSERR_NOERROR   then  
          begin  
              m_bRecording   :=   False;  
              Result   :=   True;  
          end;  
      end;  
  end;

好像没多少人有这么多工夫来检查这么多的代码。自己调试吧。哪出的问题,针对它查资料。

用Wave   Audio组件的TAudioRecorder(开源的)  
  就都不用自己写代码,呵呵~

这个组件可以实现吗????  
 

数据已实现出来了,请问哪位老大有显示波形图的函数啊。急啊

直接使用DirectX,对应数据话矩形,就可以搞定

posted @ 2008-11-05 09:37 delphi2007 阅读(391) | 评论 (0)编辑 收藏

截屏问题!急死了。 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061106092726174.html
我想截屏时只截取指定区域,而不总是全屏,不知道该怎么做。  
  高手帮帮忙。。

var  
  ghdc:   hdc;  
  gtop,gleft,gwidth,gheight:   integer;//截屏的范围  
  begin  
    ghdc:= GetDC(0);  
                      //设置截屏的范围  
    gtop:=10;  
    gleft:=10;  
    gwidth:=   100;  
    gheight:=100;  
    BitBlt(Image1.Canvas.Handle,0,0,100,100,ghdc,10,10,SRCCOPY);  
  end;

gtop,gleft,gwidth,gheight这四个参数怎么在BitBlt里没有用到?  
  BitBlt这个函数怎么使用?  
 

he   BitBlt   function   performs   a   bit-block   transfer   of   the   color   data   corresponding   to   a   rectangle   of   pixels   from   the   specified   source   device   context   into   a   destination   device   context.    
   
  BOOL   BitBlt(  
   
          HDC   hdcDest, //   handle   to   destination   device   context    
          int   nXDest, //   x-coordinate   of   destination   rectangle's   upper-left   corner  
          int   nYDest, //   y-coordinate   of   destination   rectangle's   upper-left   corner  
          int   nWidth, //   width   of   destination   rectangle    
          int   nHeight, //   height   of   destination   rectangle    
          HDC   hdcSrc, //   handle   to   source   device   context    
          int   nXSrc, //   x-coordinate   of   source   rectangle's   upper-left   corner      
          int   nYSrc, //   y-coordinate   of   source   rectangle's   upper-left   corner  
          DWORD   dwRop   //   raster   operation   code    
        );  
     
   
  Parameters  
   
  hdcDest  
   
  Identifies   the   destination   device   context.    
   
  nXDest  
   
  Specifies   the   logical   x-coordinate   of   the   upper-left   corner   of   the   destination   rectangle.  
   
  nYDest  
   
  Specifies   the   logical   y-coordinate   of   the   upper-left   corner   of   the   destination   rectangle.    
   
  nWidth  
   
  Specifies   the   logical   width   of   the   source   and   destination   rectangles.    
   
  nHeight  
   
  Specifies   the   logical   height   of   the   source   and   the   destination   rectangles.    
   
  hdcSrc  
   
  Identifies   the   source   device   context.    
   
  nXSrc  
   
  Specifies   the   logical   x-coordinate   of   the   upper-left   corner   of   the   source   rectangle.    
   
  nYSrc  
   
  Specifies   the   logical   y-coordinate   of   the   upper-left   corner   of   the   source   rectangle.    
   
  dwRop  
   
  Specifies   a   raster-operation   code.   These   codes   define   how   the   color   data   for   the   source   rectangle   is   to   be   combined   with   the   color   data   for   the   destination   rectangle   to   achieve   the   final   color.    
  The   following   list   shows   some   common   raster   operation   codes:    
   
  Value Description  
  BLACKNESS Fills   the   destination   rectangle   using   the   color   associated   with   index   0   in   the   physical   palette.   (This   color   is   black   for   the   default   physical   palette.)  
  DSTINVERT Inverts   the   destination   rectangle.  
  MERGECOPY Merges   the   colors   of   the   source   rectangle   with   the   specified   pattern   by   using   the   Boolean   AND   operator.  
  MERGEPAINT Merges   the   colors   of   the   inverted   source   rectangle   with   the   colors   of   the   destination   rectangle   by   using   the   Boolean   OR   operator.  
  NOTSRCCOPY Copies   the   inverted   source   rectangle   to   the   destination.  
  NOTSRCERASE Combines   the   colors   of   the   source   and   destination   rectangles   by   using   the   Boolean   OR   operator   and   then   inverts   the   resultant   color.  
  PATCOPY Copies   the   specified   pattern   into   the   destination   bitmap.  
  PATINVERT Combines   the   colors   of   the   specified   pattern   with   the   colors   of   the   destination   rectangle   by   using   the   Boolean   XOR   operator.  
  PATPAINT Combines   the   colors   of   the   pattern   with   the   colors   of   the   inverted   source   rectangle   by   using   the   Boolean   OR   operator.   The   result   of   this   operation   is   combined   with   the   colors   of   the   destination   rectangle   by   using   the   Boolean   OR   operator.  
  SRCAND Combines   the   colors   of   the   source   and   destination   rectangles   by   using   the   Boolean   AND   operator.  
  SRCCOPY Copies   the   source   rectangle   directly   to   the   destination   rectangle.  
  SRCERASE Combines   the   inverted   colors   of   the   destination   rectangle   with   the   colors   of   the   source   rectangle   by   using   the   Boolean   AND   operator.  
  SRCINVERT Combines   the   colors   of   the   source   and   destination   rectangles   by   using   the   Boolean   XOR   operator.  
  SRCPAINT Combines   the   colors   of   the   source   and   destination   rectangles   by   using   the   Boolean   OR   operator.  
  WHITENESS Fills   the   destination   rectangle   using   the   color   associated   with   index   1   in   the   physical   palette.   (This   color   is   white   for   the   default   physical   palette.)  
     
   
  Return   Values  
   
  If   the   function   succeeds,   the   return   value   is   nonzero.  
  If   the   function   fails,   the   return   value   is   zero.   To   get   extended   error   information,   call   GetLastError.    
   
  Remarks  
   
  If   a   rotation   or   shear   transformation   is   in   effect   in   the   source   device   context,   BitBlt   returns   an   error.   If   other   transformations   exist   in   the   source   device   context   (and   a   matching   transformation   is   not   in   effect   in   the   destination   device   context),   the   rectangle   in   the   destination   device   context   is   stretched,   compressed,   or   rotated   as   necessary.    
  If   the   color   formats   of   the   source   and   destination   device   contexts   do   not   match,   the   BitBlt   function   converts   the   source   color   format   to   match   the   destination   format.    
   
  When   an   enhanced   metafile   is   being   recorded,   an   error   occurs   if   the   source   device   context   identifies   an   enhanced-metafile   device   context.    
  Not   all   devices   support   the   BitBlt   function.   For   more   information,   see   the   RC_BITBLT   raster   capability   entry   in   GetDeviceCaps  
  .    
  BitBlt   returns   an   error   if   the   source   and   destination   device   contexts   represent   different   devices.

哈哈,忘用了,就是bitblt里面的100,10那几个数,我直接写上了

posted @ 2008-11-05 09:37 delphi2007 阅读(383) | 评论 (0)编辑 收藏

png保存到access中被加密,现解密了一部分,找一个高手来解完!如果ok付2K现金 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061106000334175.html
有一个access数据库有一个字段保存了png格式的图片,现在  
  我已经解密了其中的一部分(即已经能够显示这张图片的1/5   ),但不能显示完整!  
   
  如果你熟悉png图片的格式,请与我QQ联系:9513223!  
   
  如果能把另外的一半弄出来,我立马付2K以作酬谢!  
 

另外说明一下,本人可以提供部分技术支持和现在的二个控件,以作参考!

在asp中用:   Response.ContentType="image/Png"方式取不到数据吗?

数据库中加密,用asp当然显示不出来!

我觉得没有加密,是你的图片显示控件没有足够大的内存,只显示了PNG图的缩略图

内存够大!   可以检测到CRC错误,也就说从1/5处开始数据又被另外的方法处理了!本来是CRC数据项,但是现在这个位置不是CRC数据!  
 

这个有点棘手,看对方的加密码强度了!!

用他的程序读出来再另存不就可以了吗。  
 

如果用他的程序读出来是可以,当然只能截屏来做了,不过由于png是透明图片!余下的东西,  
  再在photoshop中就不好处理了!   因为截屏的话,会透明的显示为白色了,(但图片中细小的白色)又不好处理了!   所以截屏之后的图片,再保存成png就成了小白”脸“了!   这个小白脸,再处理起来,就太麻烦了!  
   
        或者有把白色处理成透明的办法(注意不是简单的rgb(0,0,0)   替换成透明,因为还有多像素靠近图形的,可能是偏白色!   放大了10倍来看,就知道有些白不好区分啊!  
   
 

我有兴趣能不能把库发给我看看?  
  Email:   ksprya@126.com

posted @ 2008-11-05 09:37 delphi2007 阅读(422) | 评论 (0)编辑 收藏

如何实现沿路径的文字? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061105075819176.html
比如在Canvas上画了一条曲线,然后让文字沿着这条曲线排列  
  能给个例子最好,谢谢

在路径曲线上间隔一定距离取一点,在这些点上依此写出你的字符串中的每一个字.  
  应该很容易实现!!!  
 

你讲一讲,需要的是什么样的曲线?

3方控件   不知道有么  
   
  实现的话要计算曲线大体的   切线   旋转汉字。

按我的想法,每个字是填在一个矩形里,每个字沿曲线分布时它所在的矩形旋转到切线的方向,但相邻的矩形不能有相交的部分  
  思路大体上是这样,不过不知道在delphi里该怎么实现!

查gdi   函数  
  另外曲线用矢量表示也行.

posted @ 2008-11-05 09:37 delphi2007 阅读(393) | 评论 (0)编辑 收藏

如何用DELPHI区分彩色图和黑白图(多色与单色)?? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061104175303177.html
如何用DELPHI区分彩色图和黑白图(多色与单色)??  
  如何用DELPHI区分彩色图和黑白图(多色与单色)??  
 

急呀,帮忙呀

查一查整个图像上每一个像素的颜色的RGB分量不就行了吗?  
  只要某个点的R,G,B分量不相等,   就是有彩色.

图片信息参看图片格式

scanline。  
  枚举象素,如果有一个象素是彩色的,那就退出。  
   
  如果全是黑白2色,那就是单色了

临时写了个,还没试过。  
   
  function   IsBlackAndWhiteGraphic(G:   TGraphic):   Boolean;  
  type  
      PRGBTripleArray   =   ^TRGBTripleArray;  
      TRGBTripleArray   =   array[0..32767]   of   TRGBTriple;  
      function   GetSLColor(pRGB:   TRGBTriple):   TColor;  
      begin  
          Result   :=   RGB(pRGB.rgbtRed,   pRGB.rgbtGreen,   pRGB.rgbtBlue);  
      end;  
  var  
      p:   PRGBTripleArray;  
      x,   y:   Integer;  
      Bitmap:   TBitmap;  
  begin  
      Result:=   True;  
      Bitmap:=   TBitmap.Create;  
      try  
          Bitmap.PixelFormat:=   pf24bit;  
          Bitmap.Width:=   G.Width;  
          Bitmap.Height:=   G.Height;  
          Bitmap.Canvas.Draw(0,0,G);  
   
          for   y   :=   0   to   Bitmap.Height   -   1   do  
          begin  
              p:=   Bitmap.ScanLine[y];  
              for   x   :=   0   to   (Bitmap.Width   -   1)   do  
              begin  
                  if   (GetSLColor(p[x])   <>   clBlack)   and   (GetSLColor(p[x])   <>   clWhite)   then  
                  begin  
                      Result:=   False;  
                      Break;  
                  end;  
              end;  
          end;  
   
      finally  
          Bitmap.Free;  
      end;  
  end;

多色,单色的区别只要在  
  if   (GetSLColor(p[x])   <>   clBlack)   and   (GetSLColor(p[x])   <>   clWhite)   then  
  做判断就可以了。  
 

楼上的   看过   灰度图么。。

var  
      Bitmap:   TBitmap;  
  begin  
      Bitmap   :=   TBitmap.Create;  
      Bitmap.LoadFormFile('c:\1.bmp');  
      if   Bitmap.Monochrome   then  
          ShowMessage('黑白');  
      Bitmap.Free;  
  end;  
 

posted @ 2008-11-05 09:37 delphi2007 阅读(794) | 评论 (0)编辑 收藏

窗口重画的问题 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061104164858178.html
我在form窗口用TCanvas写了一行字,写在form的标题栏位置,当我调用Refresh方法的时候,字体仍然存在,单我在Form的客户区写东西时,调用Refresh就不存在了,谁能解释一下,那要是我想标题栏的也消失,应该调用什么方法呢?谢谢大家了。

消失标题简单,Caption   :=   '';  
 

调用Refresh,窗口要检查是否确实有需要更新的部分,结果是没有,你画的他不知道,当你向窗口写东西,他就自动刷新了,你可直接用Invalidate  
 

是可以达到效果,谢谢。  
  我如果想对别的应用程序窗口实现这样的功能,应该怎么做呢。  
  大家再帮忙想一想。。

Invalidate方法也只能让客户区的内容消失。  
  我主要是想画别的应用程序窗口,然后再还原,大家想想办法。。谢谢大家了。。。  
 

我主要是想画别的应用程序窗口,然后再还原,大家想想办法。。谢谢大家了。。。  
  ================================================================================  
   
  这几天问这种问题的人不少,是否要搞什么外挂,木马什么的?  
   
   
  画别的应用程序窗口也简单,只要先取得该窗口的句柄,就可以画了.  
   
  要取得句柄可参见我在别的贴的东西  
  http://community.csdn.net/Expert/topic/5131/5131542.xml?temp=5.183047E-02  
 

我已经取得我要画的窗口的句柄了,我也把窗口的边框给改变了,可是我想当我画别的窗口的时候,这个被我画的窗口还原,所以我要得到在我画之前的窗口边框的颜色,要不还原了边框的颜色总不对,帮帮忙,想想办法,给点提示,谢谢了。。。

不会把TCanvas可以输出到标题栏?  
 

是可以输出到标题栏阿。所以我才要实现标题栏也刷新阿。。大家帮忙想想办法吧。。

posted @ 2008-11-05 09:37 delphi2007 阅读(415) | 评论 (0)编辑 收藏

这个问题有点难。 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061104112712179.html
我想得到其它应用程序的窗口大小和区域,不知道怎么办?请高手指点。  
  最好能有源代码。

var   aRect:   TRect;  
  begin  
      GetWindowRect(Handle,aRect);  
      ShowMessage(Format('(%d,%d,%d,%d)   Height:%d   Width:%d',[aRect.Left,aRect.Top,aRect.Right,aRect.Bottom,aRect.Bottom-aRect.Top,aRect.Right-aRect.Left]));  
  end;

楼上的是用窗口句柄取得窗口大小  
   
  别的应用程序的窗口句柄用   FindWindow   取得  
   
  Handle   :=   FindWindow(nil,   '窗口的标题');  
   
  如果窗口标题相同就没办法了,   会找到第一个相同的窗口

恩,高手。谢谢你们。  
  不过我还有一个问题,我想鼠标移动到一个窗口上的时候,把它的边框加粗(用颜色显示出来),这个通过你们的提示已经可以实现了,可是,我想在鼠标离开的时候就还原,怎么对别的应用程序的窗口实现这个功能,感觉一画上去就不知道怎么还原了,给点提示。谢谢了。。。  
 

我还想问一个问题。用什么方法可以通过句柄得到其它窗口边框的颜色。谢谢各位的参与。  
 

越问越多了哈  
   
  COLORREF   GetPixel(  
          HDC   hdc, //   handle   of   device   context      
          int   XPos, //   x-coordinate   of   pixel    
          int   nYPos   //   y-coordinate   of   pixel    
        );  
  得到定点处的   Color  
   
  要的参数是   DC  
   
  HDC   GetDC(  
      HWND   hWnd   //   handle   of   window      
        );  
  用你的窗口句柄取得

忘了说   上面   getdc   是取得客户区的,   想取得整个窗口可以用    
   
  HDC   GetDCEx(  
   
          HWND   hWnd, //   handle   of   window    
          HRGN   hrgnClip, //   handle   of   clip   region      
          DWORD   flags   //   device-context   creation   flags    
        );  
     
  怕你还问,   再说,   那两个   pos   是相对于窗口的,   相对于屏幕的   pos   要作一次转换  
   
  BOOL   ClientToScreen(  
   
          HWND   hWnd, //   window   handle   for   source   coordinates    
          LPPOINT   lpPoint   //   pointer   to   structure   containing   screen   coordinates      
        );  
  用的是(delphi)TPoint   结构  
   
  取得   mouse   当前位置的是    
   
  BOOL   GetCursorPos(  
   
          LPPOINT   lpPoint   //   address   of   structure   for   cursor   position      
        );  
  相对   delphi   参数应该是   var   Point:   TPoint,   这个取得的是相对屏幕的   mouse   cursor   位置

上面   ClientToScreen   说倒了,   你要用   ScreenToClient

posted @ 2008-11-05 09:37 delphi2007 阅读(278) | 评论 (0)编辑 收藏

加载图片时报错,请大虾帮忙看看! Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061103170415180.html
fbmp:TBitMap   ;  
  fbmp.loadfromfile('c:\abc.bmp');  
  执行到这一步时报错,提示读stream时出错。图片abc.bmp是经过photoshop从24位压缩到8位的。  
  如果没有压缩是不会报错的,但压缩后图片还是bmp图片,在Windows下也是可以打开的,就是  
  在Delphi下打不开,直接在Delphi中的控件Timage中也不能加载,请问哪位知道原因!

var  
        fbmp:TBitMap   ;  
  begin  
  fbmp:=     TBitMap.Create;  
  fbmp.loadfromfile('c:\abc.bmp');

fbmp:=   TBitMap.Create;

我的代码中是执行过fbmp:=   TBitMap.Create;的,只是我在这里没写出来,问题不是出在创建图片对象上。请各位指教指教!

看下错误代码。  
  PixelFormat   设置下格式看看

好象不能处理过大的图象,我试过最大处理4MB多,应该是图片太大了。

图片还没超过100K;应该不是图片的大小问题!  
  只有图片被加载后才能设置格式,因为这里加载时就报错了,所以不是PixelFormat!  
  不知哪位能帮我解答......

Delphi自带的TBitmap不能支持这种压缩格式  
  必须使用其它的图像库

直接在Delphi自带的图像控件Timage中加载都报错!

把下面的单元包含在你的程序中试试,需要编译一次。  
   
  unit   GdiplusBitmap;  
   
  interface  
   
  uses  
      Windows,   SysUtils,   ActiveX,   Classes,   Graphics;  
   
  type  
      TGdipBitmap   =   class(TBitmap)  
      public  
          procedure   LoadFromStream(Stream:   TStream);   override;  
          procedure   SaveToFile(const   Filename:   string);   override;  
          procedure   SaveToStream(Stream:   TStream);   override;  
      end;  
   
  implementation  
   
  const  
      gpdll   =   'gdiplus.dll';  
   
  type  
      TStatus   =   Integer;  
   
      PGdiplusStartupInput   =   ^TGdiplusStartupInput;  
      TGdiplusStartupInput   =   packed   record  
          GdiplusVersion:   Integer;  
          DebugEventCallback:   Pointer;  
          SuppressBackgroundThread:   BOOL;  
          SuppressExternalCodecs:   BOOL;  
      end;  
   
      TImageCodecInfo   =   packed   record  
          Clsid:   TGUID;                             //   能识别特定编码解码器的   GUID。  
          FormatID:   TGUID;                       //   识别编码解码器格式的   GUID  
          CodecName:   PWCHAR;                   //   编码解码器名称的字符串  
          DllName:   PWCHAR;                       //   存放编码解码器的   DLL   的路径名字符串  
          FormatDescription:   PWCHAR;   //   描述编码解码器的文件格式的字符串。  
          FilenameExtension:   PWCHAR;   //   编码解码器中使用的文件扩展名的字符串  
          MimeType:   PWCHAR;                     //   编码解码器的多用途网际邮件扩充协议   (MIME)   类型的字符串  
          Flags:   DWORD;                             //   有关编码解码器的其他信息(ImageCodecFlags若干标志的组合)  
          Version:   DWORD;                         //   编码解码器的版本号  
          SigCount:   DWORD;  
          SigSize:   DWORD;  
          SigPattern:   PByte;                   //   表示编码解码器签名的二维字节数组  
          SigMask:   PByte;                         //   用作筛选器的二维字节数组  
      end;  
      PImageCodecInfo   =   ^TImageCodecInfo;  
   
  function   GdiplusStartup(var   token:   DWORD;   const   input:   PGdiplusStartupInput;   output:   Pointer):   TStatus;  
          stdcall;   external   gpdll   name   'GdiplusStartup';  
  procedure   GdiplusShutdown(token:   DWORD);  
          stdcall;   external   gpdll   name   'GdiplusShutdown';  
  function   GdipCreateBitmapFromStream(stream:   ISTREAM;   var   bitmap:   Pointer):   TStatus;  
          stdcall;   external   gpdll   name   'GdipCreateBitmapFromStream';  
  function   GdipCreateBitmapFromHBITMAP(hbm:   HBITMAP;   hpal:   HPALETTE;   var   bitmap:   Pointer):   TStatus;  
          stdcall;   external   gpdll   name   'GdipCreateBitmapFromHBITMAP';  
  function   GdipSaveImageToStream(image:   Pointer;   stream:   ISTREAM;   const   clsidEncoder:   PGUID;   const   encoderParams:   Pointer):   TStatus;  
          stdcall;   external   gpdll   name   'GdipSaveImageToStream';  
  function   GdipDisposeImage(image:   Pointer):   TStatus;  
          stdcall;   external   gpdll   name   'GdipDisposeImage';  
  function   GdipCreateHBITMAPFromBitmap(bitmap:   Pointer;   var   hbmReturn:   HBITMAP;   background:   DWORD):   TStatus;  
          stdcall;   external   gpdll   name   'GdipCreateHBITMAPFromBitmap';  
  function   GdipGetImageEncodersSize(var   numEncoders,   size:   Integer):   TStatus;  
          stdcall;   external   gpdll   name   'GdipGetImageEncodersSize';  
  function   GdipGetImageEncoders(numEncoders,   size:   Integer;   encoders:   PImageCodecInfo):   TStatus;  
          stdcall;   external   gpdll   name   'GdipGetImageEncoders';  
  function   GdipGetImagePixelFormat(image:   Pointer;   var   format:   Integer):   TStatus;  
          stdcall;   external   gpdll   name   'GdipGetImagePixelFormat';  
   
  type  
      TGpBitmap   =   class  
      public  
          Native:   Pointer;  
          constructor   Create(stream:   IStream);   overload;  
          destructor   Destroy;   override;  
          constructor   Create(hbm:   HBITMAP;   hpal:   HPALETTE);   overload;  
          function   GetHBITMAP:   HBITMAP;  
          function   GetPixelFormat:   Integer;  
          procedure   Save(stream:   IStream;   const   clsidEncoder:   TCLSID);  
      end;  
   
  procedure   CheckStatus(Status:   TStatus);  
  begin  
      if   Status   <>   0   then  
          raise   Exception.Create('Gdiplus   Error!');  
  end;  
   
  {   TGpBitmap   }  
   
  constructor   TGpBitmap.Create(stream:   IStream);  
  begin  
      CheckStatus(GdipCreateBitmapFromStream(stream,   Native));  
  end;  
   
  constructor   TGpBitmap.Create(hbm:   HBITMAP;   hpal:   HPALETTE);  
  begin  
      CheckStatus(GdipCreateBitmapFromHBITMAP(hbm,   hpal,   Native));  
  end;  
   
  destructor   TGpBitmap.Destroy;  
  begin  
      GdipDisposeImage(Native);  
  end;  
   
  function   TGpBitmap.GetHBITMAP:   HBITMAP;  
  begin  
      CheckStatus(GdipCreateHBITMAPFromBitmap(Native,   Result,   0));  
  end;  
   
  function   TGpBitmap.GetPixelFormat:   Integer;  
  begin  
      CheckStatus(GdipGetImagePixelFormat(Native,   Result));  
  end;  
   
  procedure   TGpBitmap.Save(stream:   IStream;   const   clsidEncoder:   TCLSID);  
  begin  
        CheckStatus(GdipSaveImageToStream(Native,   stream,   @clsidEncoder,   nil));  
  end;  
   
  var  
      GdiplusStartupInput:   TGdiplusStartupInput;  
      gdipToken:   DWord;  
      ImageFormat:   string   =   '';  
   
  procedure   SetImageFormat(const   Filename:   string);  
  begin  
      ImageFormat   :=   ExtractFileExt(Filename);  
      if   ImageFormat   <>   ''   then  
      begin  
          Delete(ImageFormat,   1,   1);  
          if   CompareText(ImageFormat,   'jpg')   =   0   then  
              ImageFormat   :=   'jpeg'  
          else   if   CompareText(ImageFormat,   'tif')   =   0   then  
              ImageFormat   :=   'tiff';  
      end   else   ImageFormat   :=   'bmp';  
      ImageFormat   :=   'image/'   +   ImageFormat;  
  end;  
   
  function   GetImageEncoderClsid(format:   String;   var   Clsid:   TGUID):   integer;  
  var  
      num,   size,   i:   Integer;  
      ImageCodecInfo:   PImageCodecInfo;  
  type  
      InfoArray   =   array   of   TImageCodecInfo;  
  begin  
      num     :=   0;  
      size   :=   0;  
      Result   :=   -1;  
      GdipGetImageEncodersSize(num,   size);  
      if   (size   =   0)   then   exit;  
      GetMem(ImageCodecInfo,   size);  
      if(ImageCodecInfo   =   nil)   then   exit;  
      try  
          GdipGetImageEncoders(num,   size,   ImageCodecInfo);  
          i   :=   0;  
          while   (i   <   num)   and   (CompareText(InfoArray(ImageCodecInfo)[i].MimeType,   format)   <>   0)   do  
              Inc(i);  
          if   i   <   num   then  
          begin  
              Clsid   :=   InfoArray(ImageCodecInfo)[i].Clsid;  
              Result   :=   i;  
          end;  
      finally  
          FreeMem(ImageCodecInfo,   size);  
      end;  
  end;  
   
  {   TGdipBitmap   }  
   
  procedure   TGdipBitmap.LoadFromStream(Stream:   TStream);  
  var  
      Adaper:   TStreamAdapter;  
      tmp:   TGpBitmap;  
  begin  
      Adaper   :=   TStreamAdapter.Create(Stream,   soReference);  
      tmp   :=   TGpBitmap.Create(Adaper);  
      try  
          Handle   :=   tmp.GetHBITMAP;  
          case   (tmp.GetPixelFormat   shr   8)   and   $ff   of  
              1:   PixelFormat   :=   pf1bit;  
              4:   PixelFormat   :=   pf4bit;  
              8:   PixelFormat   :=   pf8bit;  
              16:   PixelFormat   :=   pf16bit;  
              24:   PixelFormat   :=   pf24bit;  
              32:   PixelFormat   :=   pf32bit;  
              else   PixelFormat   :=   pfCustom;  
          end;  
      finally  
          tmp.Free;  
      end;  
  end;  
   
  procedure   TGdipBitmap.SaveToFile(const   Filename:   string);  
  begin  
      SetImageFormat(Filename);  
      inherited   SaveToFile(Filename);  
      ImageFormat   :=   '';  
  end;  
   
  procedure   TGdipBitmap.SaveToStream(Stream:   TStream);  
  var  
      tmp:   TGpBitmap;  
      Adaper:   TStreamAdapter;  
      Clsid:   TGUID;  
  begin  
      if   (ImageFormat   <>   '')   and   (GetImageEncoderClsid(ImageFormat,   Clsid)   <>   -1)   then  
      begin  
          tmp   :=   TGpBitmap.Create(Handle,   Palette);  
          try  
              Adaper   :=   TStreamAdapter.Create(Stream,   soReference);  
              tmp.Save(Adaper,   Clsid);  
          finally  
              tmp.Free;  
          end;  
      end   else  
          inherited   SaveToStream(Stream);  
  end;  
   
  initialization  
  begin  
      FillChar(GdiplusStartupInput,   Sizeof(GdiplusStartupInput),   0);  
      GdiplusStartupInput.GdiplusVersion   :=   1;  
      GdiplusStartup(gdipToken,   @GdiplusStartupInput,   nil);  
      TPicture.RegisterFileFormat('bmp',   'BMP   File',   TGdipBitmap);  
      TPicture.RegisterFileFormat('Exif',   'TIFF   File',   TGdipBitmap);  
      TPicture.RegisterFileFormat('tiff',   'TIFF   File',   TGdipBitmap);  
      TPicture.RegisterFileFormat('tif',   'TIFF   File',   TGdipBitmap);  
      TPicture.RegisterFileFormat('png',   'PNG   File',   TGdipBitmap);  
      TPicture.RegisterFileFormat('gif',   'GIF   File',   TGdipBitmap);  
      TPicture.RegisterFileFormat('jpeg',   'JPEG   File',   TGdipBitmap);  
      TPicture.RegisterFileFormat('jpg',   'JPG   File',   TGdipBitmap);  
  end;  
  finalization  
  begin  
      TPicture.UnregisterGraphicClass(TGdipBitmap);  
      GdiplusShutdown(gdipToken);  
  end;  
   
  end.

包含上面单元,编译一次,可直接从TImage载入,如果使用TBitmap,可以用以下代码:  
  var  
      fbmp:TBitMap   ;  
      tmp:   TGdipBitmap;  
  begin  
      tmp   :=   TGdipBitmap.Create;  
      tmp.LoadFromFile('c:\abc.bmp');  
      fbmp.Assign(tmp);  
      tmp.Free;  
  end;  
   
 

路过

var  
      fbmp:TBitMap   ;  
      tmp:   TGdipBitmap;  
  begin  
      tmp   :=   TGdipBitmap.Create;  
      tmp.LoadFromFile('c:\abc.bmp');  
      fbmp   :=   TBitmap.Create;  
      fbmp.Assign(tmp);  
      tmp.Free;  
  end

TO:maozefa(阿发伯)    
  程序中加了以上代码后无法运行!

程序中加了以上代码后无法运行!  
  ==================================================  
  你用的什么操作系统?

我重新试了一下,上面代码在XP,2000下绝对没有问题的。你的图像能否装进来是另一会事,但是应该不可能无法运行。除非你的操作系统是98。

如果你的操作系统是98,可以下载Gdiplus.DLL到你的系统或者你的程序目录

我的电脑系统是Win2000个人版的,运行之前我也搜索了一下Gdiplus.DLL,系统中可以找到Gdiplus.DLL的,加了GdiplusBitmap之后,可以编译,但不能运行。

有一个gdi+包   你下载一下把pas文件加到你的项目里,,在网上可以找到

To:hongqi162(失踪的月亮)  
  能不能给个具体的名字!

怎么没人回答。

自带的image不支持这种压缩格式吧。

delphi中就是这样,有时候bmp的在window中能打开,但是在delphi中就不能加载,也可能是你那个本本就不是bmp的,但是后缀是bmp的,这样的文件在window中是能打开的,但是delphi会检测是不是真的bmp文件,如果不是就报错了.....

^

GDI+包下载:  
  http://www.2ccc.com/article.asp?articleid=3131  
  GDI+已经支持非常的图形格式,图像处理增强,更易用。。。

posted @ 2008-11-05 09:36 delphi2007 阅读(812) | 评论 (0)编辑 收藏

在执行存储过程时我想在界面上显示时间进度 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061103143720181.html
在执行存储过程时我想在界面上显示时间进度  
  怎么做到??  
 

进度具体是啥意思,还有这个问题看起来好象是数据库方面的,怎么在"GAME,图形处理/多媒体   "中啊

随便做一个动画  
       
 

posted @ 2008-11-05 09:36 delphi2007 阅读(368) | 评论 (0)编辑 收藏

在image中如何画出一个点? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061103142036182.html
请高手指教,最好能给个例子吧,^_^,不胜感激

C#  
  可以给你个例子但是delphi的没有

要用到什么函数吗?有那些关于画图的简单函数啊?

gdi   函数   SetPixel   。。

能给我一个例子吗?thx!

在image的10,10上画一个红点  
      Image1.Canvas.Pixels[10,10]:=clRed;  
 

thx!还有一个问题,请问怎样消除刚才在image所画的线呢?

..没有擦除   只能重绘   或者记录   信息   undo..

图象对于计算机来说   就是     数组。。   你改变了   要改回来   就是要记住以前的   数组元素信息。。

Image1.Canvas.Pen.Mode   :=   pmNotXor;  
  Image1.Canvas.Pixels[10,10]:=clRed;  
  调用1次绘制,第2次清除  
   
 

擦除的话,可用底色重画一下:  
      Image1.Canvas.Pen.Color:=clRed;  
    Image1.Canvas.LineTo(100,100);  
  ...  
      Image1.Canvas.Pen.Color:=clWhite;    
      Image1.Canvas.MoveTo(0,0);  
      Image1.Canvas.LineTo(100,100);

SetPixel

posted @ 2008-11-05 09:36 delphi2007 阅读(547) | 评论 (0)编辑 收藏

QQ添加好友时的验证码识别问题 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061102022023183.html
QQ添加好友时的验证码识别问题  
  开发语言   delphi   给个思路???  
  谁有代码,贴个上来,不胜感激

怎么就没人理我呀,UP

再次up

我刚做了一个,我的QQ群:5616247中有相关内容。  
  http://group.qq.com/group_index.shtml?groupid=5616247  
 

简单的   象素对比   训练下就行了.  
   
  复杂的   要用   ai方法   有很多成熟的   方法

去搜搜模式识别方面的文章看看,涉及到人工智能的问题

说起代码,www.tomore.com上有一个,是识别网页验证码的

我也做了一个类似的,其实可以不走图像处理这条路的。  
  验证的时候随机从服务器抽取一张图片,每张图片有一个名称,每个名称对应一个变量如字符串。事实上你验证这个字符串就行了!  
   
  而一般的注册机根本没办法提取这个字符串!这样完全可以达到你的效果!

我们专业做验证码识别的,加我QQ吧,详谈  
   
  广告:  
   
  代理投票   免费投票   自动投票软件   投票机   刷票机   投票软件下载    
  投票作弊工具   投票作弊器   自动刷票机   短信投票   网上投票作弊   刷票方法    
  投票软件下载   刷票机下载   免费刷票机   重复投票   刷票器2.0   刷票器1.8    
  全面突破IP限制、帐号限制、来路检测、验证码等,快速+安心完美解决方案!  
  详情请访问   http://www.zdtp.com     http://www.dltoupiao.com

posted @ 2008-11-05 09:36 delphi2007 阅读(370) | 评论 (0)编辑 收藏

更换录象闪烁 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061101184922184.html
我用mediaplayer播放MPG文件,当一段播完,再换另一段播放时,会闪烁,请问怎么样消除这种闪烁现象  
   
      这是换另一段的程序  
          mediaplayer1.FileName:='E:\20台\mpeg\2.mpg';  
          mediaplayer1.Open   ;  
          MediaPlayer1.Play   ;

有人回答吗

是否机器性能不够高?

晕。跟这没太大关系吧,512M的内存不是非常慢吧

posted @ 2008-11-05 09:36 delphi2007 阅读(216) | 评论 (0)编辑 收藏

MP3文件的id3v1和id3v2信息分别保存在文件中的什么位置? Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061031235307185.html
MP3文件的id3v1和id3v2信息分别保存在文件中的什么位置?

id3v1:后128字节  
  id3v2:0-

posted @ 2008-11-05 09:36 delphi2007 阅读(335) | 评论 (0)编辑 收藏

求助!如何在动态改变大小的Image上画图! Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061031221025186.html
程序需要在能动态改变大小的Image上画图.  
  初始的Image控件大小为一个屏幕。在运行中当动态的将宽高改为超出当前屏幕后,所画图在超出屏幕的部分却无法显示。放佛仅仅是Image大小改变,而Canvas却未延展到屏幕外区域。  
   
  已经试过将Image控件放在一个ScrollBox内,依然无效,求助!  
 

用image画?  
  你没有处理WM_PAINT消息进行重画,当然画不出来了。  
  不用超出屏幕,随便一个窗口往你的image上面一遮,你所画的就没有了。  
  应该用paintbox,在它的onpaint方法里画.

不要用Image.Canvas  
  用Image.Picture.Bitmap.Canvas   就可以了  
  注意对于Image.Picture.Bitmap的大小的处理要正确

设置Image空间的拉伸属性试试看。。  
  Image.Stretch   :=   True;

设定不让它画到边框外边不就行了  
   
  如果最后的点超出边框,就用最大的边框值的点来代替~~!

已经自己解决,其实要改image.picture.bitmap的宽高

:)

在Image改变大小时,其实内部使用的Bitmap对象没有一起更改。你只要手动修改这个就好了。

建议使用矢量图形组件TCAD  
  http://www.codeidea.com/cn/  
   
 

posted @ 2008-11-05 09:36 delphi2007 阅读(491) | 评论 (0)编辑 收藏

仅列出标题
共34页: First 21 22 23 24 25 26 27 28 29 Last