高手们,我做了一个摄像头采集图片的程序,关键是用户要求能在采集的图片上进行简单的操作,其中一个很关键的是要能在图片上添加文字,以及符号(如打个“√”),怎么解决,谢谢大家!

解决方案 »

  1.   

    将那个JPG调用Image中,然后再用Canvas画布编辑即可象“√”这类的特殊符号,楼主可以事先定义为一张张的图片
    然后再贴上即可
      

  2.   


            ImageMoney->Canvas->Pen->Color=clYellow;
            ImageMoney->Canvas->Font->Color =clYellow;
            ImageMoney->Canvas->Font->Name ='宋体';
            ImageMoney->Canvas->Font->Size =14;
            ImageMoney->Canvas->Font->Height=21;
            ImageMoney->Canvas->Font->Style =TFontStyles()<< fsBold ;
            ImageMoney->Canvas->Brush->Color =clYellow;
            ImageMoney->Canvas->Brush->Style =bsClear;
            ImageMoney->Canvas->TextOutA(15,15,"要输出的文字"); 把->换成 .
    ImageMoney是图片控件
      

  3.   

    ImageMoney->Canvas->TextOutA(15,15,"√");
      

  4.   

    在原来的位置,重画一遍  但话的模式 换成  
    image .CopyMode   =cmMergePaint;//cmPatInvert 试一下 我记不清楚了,不行的画在help中输入刚才这个词,找到copymode 看一下,意思是用xor把原来的地方的土重画一遍 把原来的编程透明
      

  5.   

    //>>>>>>>>>>>>>>>>>>读入录像截图并写时间>>>>>>>>>>>>>>>>>>>>>
              Bmp:=TBitmap.Create();
              try
                try
                  if not SDKV_CaptureImage(Bmp) then begin  //读入录像截图
                    MessageBox(Application.Handle,pchar('Can not capture image!'),pchar(Application.Title),MB_ICONWARNING);
                    exit;
                  end;
                  //设字体透明
                  SetBKMode(Bmp.Canvas.Handle,TRANSPARENT);
                  //写时间
                  Bmp.Canvas.Font.Color := clBlack;
                  Bmp.Canvas.TextOut(11,3,DateToStr(now)+' '+Timetostr(time));
                  Bmp.Canvas.Font.Color := clWhite;
                  Bmp.Canvas.TextOut(10,2,DateToStr(now)+' '+Timetostr(time));
                  Image2.Picture.Bitmap.Assign(Bmp);   //读Bmp至 Image2
                except
                  MessageBox(Application.Handle,pchar('Error when export image!'),pchar(Application.Title),MB_ICONERROR);
                end;
              finally
                Bmp.Free;
              end;          //>>>>>>>>>>>>>>>>>>读入录像截图写时间END>>>>>>>>>>>>>>>>>>
      

  6.   

    //这个是读文件的函数
    function SDKV_CaptureImage(Bmp:TBitmap):Boolean;
    //capture the image into bmp
    //2003.01.10
    var
      BmpFileName:String;
    begin
      Result:=false;
      try
        if FCardIndex<0 then
          exit;
        BmpFileName:=ExtractFilePath(Application.ExeName)+'Capture.bmp';
        if FileExists(BmpFileName) then begin
          if not DeleteFile(BmpFileName) then
            exit;
        end;
        DSStream_SaveToBmpFile(0,pchar(BmpFileName));
        if not FileExists(BmpFileName) then
          exit;
        Bmp.LoadFromFile(BmpFileName);
        Result:=true;
      except
      end;
    end;