Use the MD5 method to change the picture in the Cximage:
Delphi7 Implementation Method:
usesidhashmessagedigestfunctionTFORM1.GETIMAGEMD5 (cximage:tcximage):string;varTmpmd5:tidhashmessagedigest5; Ms:tmemorystream;beginResult:="'; ifCximage.picture.graphic=Nil Thenexit; TmpMD5:=tidhashmessagedigest5.create; MS:=tmemorystream.create; TryCxImage.Picture.Graphic.SaveToStream (MS); Result:=Tmpmd5.ashex (Tmpmd5.hashvalue (ms)); finallyTmpmd5.free; Ms. Free; End;End;
View Code
Delphi2010 Implementation Method:
1 usesidhashmessagedigest2 3 functionGetImageMD5 (cximage:tcximage):string;4 var5 Tmpmd5:tidhashmessagedigest5;6 Ms:tmemorystream;7 begin8result:="';9 ifCximage.picture.graphic=Nil Thenexit;Tentmpmd5:=tidhashmessagedigest5.create; Onems:=tmemorystream.create; A Try - CxImage.Picture.Graphic.SaveToStream (MS); -Ms. position:=0; theresult:=Tmpmd5.hashstreamashex (MS); - finally - Tmpmd5.free; - Ms. Free; + End; - End;
View Code
Reference: http://www.cnblogs.com/jxsoft/archive/2011/08/08/2131436.html
Delphi uses MD5 to compare files