Jump to content

UniSpecial Component


Hayri ASLAN

Recommended Posts

Hi David,

 

I am not experienced with C++.

 

The other 3rd party components are working properly?

Hi Hayri,

I can build http://forums.unigui.com/index.php?/topic/3446-tunicaptcha-stop-spam-draw-shapes/?hl=captchawith C++ Builder 10.1 and work fine.

You give me the source codes like "tunicaptcha".I can build it for C++ Builder 10.1 , will you?

 

Best,

David

Link to comment
Share on other sites

Hi,

In webcam.min.js

 

    hooks: {
        load: null,
        live: null,
        uploadcomplete: null,
        uploadprogress: null,
        error: function(e) {
           alert("Webcam.js Error: " + e) ------- > these alerts
        }
 
Thanks
Mark
Link to comment
Share on other sites

Hi Hayri,

Thanks very much for that, I can see how I can use it.

However, what I want to do is replace the browser alerts with say a showmessage or unispnoty, but I'm a beginner in js.

so...

I have a new property in unispwebcam called FCamMessage

 

  private
  FonSnapshot : TChangeEvent;
  FDestinationWidth, FDestinationHeight : integer;
  FCamMessage : string;
 
I'd like to be able to bring back the messages (mostly error) generated in the webcam.min.js in an ajax event and put the result in FCamMessage (published as CamMessage).
 
In my main form I can then check unispwebcam.cammessage and create a unispnoty to inform user and/ or do some other action.
 
So far I have in UniSPWebCam.pas;
 
1. I have the new publshed property CamMessage.
2. I have added to ajax procedure as below.
 
procedure TUniSpWebcam.Ajax(Sender: TComponent; EventName: string;
  Params: TUniStrings);
var
  SS: TStringStream;
  MS: TMemoryStream;
  FN: String;
begin
   if EventName='snap' then
    begin
     SS := TStringStream.Create(Params.Values['data']);
      try
        MS := TMemoryStream.Create();
        try
          DecodeStream(SS, MS);
          FN := UniServerInstance.LocalCachePath + IntToStr(Random(10000000))+'.jpg';
          MS.SaveToFile(FN);
        finally
          MS.Free;
        end;
      finally
        SS.Free;
      end;
 
     if Assigned(onSnapshot) then onSnapshot(Self, FN);
    end
    else
    if EventName='Mes' then
    begin
       // assign params.values['txt']  to CamMessage
    end;
end;
 
but I'm struggling with the ajax request as in 
 
procedure TUniSpWebcam.StartWebcam;
var
data:string;
begin
    data:='Webcam.set({ '+
      ' width: '+IntToStr(Width)+','+
      ' height: '+IntToStr(Height)+','+
      ' dest_width: '+IntToStr(DestinationWidth)+','+
      ' dest_height: '+IntToStr(DestinationHeight)+','+
      ' image_format: ''jpeg'', '+
      ' jpeg_quality: 100  '+
      ' }); '+
      ' Webcam.attach( ''#UniSpWebcam'' ); '+
      ' Webcam.hooks.error = function(e) {ajaxrequest('+Self.JSName+', "mes" ,["txt="+function(e) {"this is a test "+e}])}; ';// This is completely wrong!!
      UniSession.AddJS(data);
end;
 
What do I need to do to bring back the text of the messages in webcam.min.js and put the result in CamMessage
 
I hope that makes sense to you.
 
And thanks for your help and patience.
Regards
Mark
 
Link to comment
Share on other sites

hi,

 

This is not correct

 Webcam.hooks.error = function(e) {ajaxrequest('+Self.JSName+', "mes" ,["txt="+function(e) {"this is a test "+e}])};

You need to change to this

Webcam.hooks.error = function(e) {
   ajaxRequest('+Self.JSName+', "mes" ,["txt="+e]);
}
Link to comment
Share on other sites

  • 1 month later...
For some reason none of the UniSpecial components work on some of my projects.

I'm using FMSoft_uniGUI_Complete_Professional_1.0.0.1391_RC with Delphi XE10.1.

The odd thing is that the UniSpecial demo works perfectly.

 

Do you have any advice that can help me to review.

 

I get the error



 

sweetAlert({   title: "Title",  text: "",  type: "success",   allowOutsideClick: false,  showCancelButton: false,  closeOnConfirm: true,  confirmButtonText: "OK" ,  confirmButtonColor: "#AEDEF4" ,  cancelButtonText: "Cancel" ,  imageUrl: "" , 

 }, function(isConfirm){   if (isConfirm) {  ajaxRequest(O4DA, "onConfirm", []);  } else {   ajaxRequest(O4DA, "onCancel", []);   } });


 

 


 

post-202-0-22499700-1493358258_thumb.png

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...