CCD Camera Library

taximania

Well-Known Member
Licensed User
Longtime User

tsteward

Well-Known Member
Licensed User
Longtime User
Thanks Dimitris this dll is pretty good and works well for me.

The only problem I have is the default filename is ignored. File is saved as "image190"

Mybad, It works fine I just didn't understand (Didint read the instructions again doh)
 
Last edited:

Steve

Member
Licensed User
Longtime User
Awesome library!

Would there be a way to bypass the filename dialog in a future version? I am blind and am interested in using this to turn my phone into a color identifier/light sensor.

Best regards,
Steve
 

tsteward

Well-Known Member
Licensed User
Longtime User
Is this a bug or do I not understand.

My Code
B4X:
img = ccd.GetImage2(640, 480, 0, "Main.Form1", "Camera", main.wikiDir, "CameraImg")
I thought the last parameter was the image name. However all my photo's come back with the name "Image_001.jpg" The number does increment though.
 

tsteward

Well-Known Member
Licensed User
Longtime User
GetImage only has five parameters but appear to think that there are seven! The IDE will ignore your extra parameters but if you optimise compile it you will get an error

And yet the example in the zip from post #6 (i think) has the following code with seven parameters
B4X:
Sub Globals
    'Declare the global variables here.

End Sub

Sub App_Start
    ccd.New1 
    Form1.Show
End Sub


Sub Button1_Click
    Dim img
    
    'img = ccd.GetImage(640, 480, 0, "Form1", "Camera")
    img = ccd.GetImage2(640, 480, 0, "Form1", "Camera", "\My Documents", "TestImage")
    Msgbox(img)
    If img <> "" Then form1.Image = img
End Sub

Sub Button2_Click
    'Msgbox(ccd.GetVideo(640, 480, 65535, "Form1", "Camera"))
    Msgbox(ccd.GetVideo2(640, 480, 65535, "Form1", "Camera", "\My Documents", "TestVideo"))
End Sub
 

agraham

Expert
Licensed User
Longtime User
:signOops::sign0013:You're right, I overlooked the significance of GetImage2 :(. I looked at dzCameraCapture in my local archive which I had obviously failed to update with the later version (I have now :)).

I have looked in the library with Reflector and there is nothing wrong there. Unlike most other dialogs, which are part of Windows Mobile, the CameraCapture dialog is written by the manufacturer of the device to suit the hardware, although it must conform to a Microsoft specification so that all CameraDialogs look the same to the OS. In your case it looks like a bug in the dialog is ignoring the filename given to it and is always using its own default so your only recourse seems to be to rename the files after capture to the names you want.
 

kohle

Active Member
Licensed User
Longtime User
Your lib is working fine but the problem is on some devices i dont know
the resolution (width x height) , because it says 1m, 2m and so on.

Is there a way to use the default resolution of the camera.
 

TWELVE

Active Member
Licensed User
How can i let check my code for a camera before i call the camera dialog...?
My App is running on desktop and different device version with and without built-in cameras.I would like to avoid throwing an exception to the user if there's no camera available....


regards,

TWELVE
 

TWELVE

Active Member
Licensed User
Sure, that's possible, but i would like to avoid triggering and catching an exception, especially because i do not know what kind of exceptions are generated if there's no camera.



regards,

TWELVE
 

Cableguy

Expert
Licensed User
Longtime User
Is it that important to know what exception is being called?
Either you can or you cannot use the camera!!
That's what important to you, right?
So if there is NO camera, or the camera is not compliant, you cannot use it...That should be enought info, for your app...
Why make it more complex, trying to know exactly why, if it is only important to know if it can!
 
Last edited:

TWELVE

Active Member
Licensed User
An exception is a critical situation in a program rather than a normal error handling.Certainly, you could build up a program not taking care of errors and do the handling just by throwing and catching exceptions.I personally don't like that and furthermore do not think that this is a good rule for programming.

On the other side, i do not own a device with an internal camera, thus i cannot check safely if the exception is caused by the missing camera support or by an error in the code.The message i get is just not as clear enough to point to a missing internal camera.

regards,

TWELVE
 

sitajony

Active Member
Licensed User
Generaly if it works on a device so the code is ok so the only error who can be shown is "No camera found"...
 

Tex8503

Active Member
Licensed User
Longtime User
Is anyone aware of a way to hide the titlebar when using this library ? I'm making a kiosked application and it'd be desireable not to allow them to break out of it when they use the camera...

Thoughts?
 
Top