12 Replies - 1297 Views - Last Post: 08 May 2012 - 08:00 AM Rate Topic: -----

#1 deduu10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 01-May 12

creating GUI with VIDEO CAMERA background

Posted 03 May 2012 - 07:46 AM

hai ...

I'm learning how to create GUI with GTK+.

does anybody know how to create GUI with video camera background using GTK+? is it possible or not?

thank you.
Is This A Good Question/Topic? 0
  • +

Replies To: creating GUI with VIDEO CAMERA background

#2 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 710
  • View blog
  • Posts: 2,033
  • Joined: 20-March 10

Re: creating GUI with VIDEO CAMERA background

Posted 04 May 2012 - 03:39 PM

View Postdeduu10, on 03 May 2012 - 02:46 PM, said:

does anybody know how to create GUI with video camera background using GTK+? is it possible or not?

thank you.


I would say not possible,

The reasons for this is you have to access the api in a very low and specific way,

The api for video camera's actually sets up a render window so it can transfer its picture.

GTK+ and Qt and wxWidgets all try and shield you from this api while maintaining cross platform
compatibility, unless the GTK+ authors add a video camera api to GTK+ then it's hard to see how to do that.

You could however I suppose use a gtk pixmap copied from the original render window which you could just hide
This would obviously lead to a very jumpy picture and you would have to learn the specific api for the camera
anyway, so I just dont see the point.

Best Wishes

Snoopy.
Was This Post Helpful? 0
  • +
  • -

#3 deduu10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 01-May 12

Re: creating GUI with VIDEO CAMERA background

Posted 05 May 2012 - 08:13 AM

View Postsnoopy11, on 04 May 2012 - 03:39 PM, said:

View Postdeduu10, on 03 May 2012 - 02:46 PM, said:

does anybody know how to create GUI with video camera background using GTK+? is it possible or not?

thank you.


I would say not possible,

The reasons for this is you have to access the api in a very low and specific way,

The api for video camera's actually sets up a render window so it can transfer its picture.

GTK+ and Qt and wxWidgets all try and shield you from this api while maintaining cross platform
compatibility, unless the GTK+ authors add a video camera api to GTK+ then it's hard to see how to do that.

You could however I suppose use a gtk pixmap copied from the original render window which you could just hide
This would obviously lead to a very jumpy picture and you would have to learn the specific api for the camera
anyway, so I just dont see the point.

Best Wishes

Snoopy.


I see, thank you snoopy. By the way, do you have any suggestion what should I use to create GUI with video camera background?

thanks
Was This Post Helpful? 0
  • +
  • -

#4 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 710
  • View blog
  • Posts: 2,033
  • Joined: 20-March 10

Re: creating GUI with VIDEO CAMERA background

Posted 05 May 2012 - 10:06 AM

Deduu10 said

Quote

I see, thank you snoopy. By the way, do you have any suggestion what should I use to create GUI with video camera background?


Yes the native api for the operating system.

This is called the Win32 api in Windows.

Assuming your running Windows there is my Win32 WebCam Program Tutorial

Tutorial click here,

If its a *nix system then you will have to learn the native api.

Best Wishes

Snoopy.
Was This Post Helpful? 1
  • +
  • -

#5 deduu10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 01-May 12

Re: creating GUI with VIDEO CAMERA background

Posted 06 May 2012 - 06:30 AM

View Postsnoopy11, on 05 May 2012 - 10:06 AM, said:

Deduu10 said

Quote

I see, thank you snoopy. By the way, do you have any suggestion what should I use to create GUI with video camera background?


Yes the native api for the operating system.

This is called the Win32 api in Windows.

Assuming your running Windows there is my Win32 WebCam Program Tutorial

Tutorial click here,

If its a *nix system then you will have to learn the native api.

Best Wishes

Snoopy.


thanks in advance snoopy..
Was This Post Helpful? 0
  • +
  • -

#6 deduu10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 01-May 12

Re: creating GUI with VIDEO CAMERA background

Posted 07 May 2012 - 03:02 AM

View Postsnoopy11, on 05 May 2012 - 10:06 AM, said:

Deduu10 said

Quote

I see, thank you snoopy. By the way, do you have any suggestion what should I use to create GUI with video camera background?


Yes the native api for the operating system.

This is called the Win32 api in Windows.

Assuming your running Windows there is my Win32 WebCam Program Tutorial

Tutorial click here,

If its a *nix system then you will have to learn the native api.

Best Wishes

Snoopy.


Snoopy, I tried compiling your code to visual studio 2008, but it results errors like this


Error 10 error C2440: 'initializing' : cannot convert from 'const wchar_t [7]' to 'char []' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 28 my001
Error 11 error C2440: '=' : cannot convert from 'char []' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 54 my001
Error 12 error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'char []' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 59 my001
Error 13 error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 95 my001
Error 14 error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 97 my001
Error 15 error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 99 my001
Error 16 error C2664: 'capCreateCaptureWindowW' : cannot convert parameter 1 from 'const char [14]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 101 my001
Error 17 error C2664: 'CreateBMPFile' : cannot convert parameter 2 from 'const char [10]' to 'LPTSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 152 my001
Error 18 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [12]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 193 my001
Error 19 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [10]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 199 my001
Error 20 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [11]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 205 my001
Error 21 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [16]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 218 my001
Error 22 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [16]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 223 my001
Error 23 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [10]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 230 my001
Error 24 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [12]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 235 my001
Error 25 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [10]' to 'LPCWSTR' c:\users\dedy\documents\visual studio 2008\projects\my001\my001\my001.cpp 250 my001

do you know how to fix it?
Was This Post Helpful? 0
  • +
  • -

#7 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,222
  • Joined: 23-August 08

Re: creating GUI with VIDEO CAMERA background

Posted 07 May 2012 - 03:06 AM

Go to the FAQs topic pinned at the top of the forum and scroll down to the Common Windows/Visual Studio errors section.
Was This Post Helpful? 1
  • +
  • -

#8 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 710
  • View blog
  • Posts: 2,033
  • Joined: 20-March 10

Re: creating GUI with VIDEO CAMERA background

Posted 07 May 2012 - 05:04 AM

Yes,

I know what's wrong..
You're trying to build it as a Unicode
Build.

I do say in the Tutorial it's not a Unicode
Build.

Change the character set from Unicode
to Multi-Byte.

Also the other posts in the Tutorial if
you had read them, would have gave
You the answer.

Snoopy.
Was This Post Helpful? 1
  • +
  • -

#9 deduu10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 01-May 12

Re: creating GUI with VIDEO CAMERA background

Posted 07 May 2012 - 07:13 AM

View Postsnoopy11, on 07 May 2012 - 05:04 AM, said:

Yes,

I know what's wrong..
You're trying to build it as a Unicode
Build.

I do say in the Tutorial it's not a Unicode
Build.

Change the character set from Unicode
to Multi-Byte.

Also the other posts in the Tutorial if
you had read them, would have gave
You the answer.

Snoopy.


thanks snoopy. I successfully compiled these code. but the video camera did not work.

it appeared like this
http://i49.tinypic.com/2drs6rt.jpg

did I miss some steps?
Was This Post Helpful? 0
  • +
  • -

#10 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 710
  • View blog
  • Posts: 2,033
  • Joined: 20-March 10

Re: creating GUI with VIDEO CAMERA background

Posted 07 May 2012 - 12:28 PM

Right there is a few things it could be...

I have tested the program on PC's running xp, vista and 7

all worked fine...

It could be a problem with your usb root hub...

Solution to that here

Finally you could be using a laptop....

now on some laptops it works fine on some you get a black screen...

I have never managed to figure out why ..?

Are you using a laptop ?

Which laptop are you using ?

Best Wishes

Snoopy.

This post has been edited by snoopy11: 07 May 2012 - 12:30 PM

Was This Post Helpful? 0
  • +
  • -

#11 deduu10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 01-May 12

Re: creating GUI with VIDEO CAMERA background

Posted 07 May 2012 - 10:44 PM

View Postsnoopy11, on 07 May 2012 - 12:28 PM, said:

Right there is a few things it could be...

I have tested the program on PC's running xp, vista and 7

all worked fine...

It could be a problem with your usb root hub...

Solution to that here

Finally you could be using a laptop....

now on some laptops it works fine on some you get a black screen...

I have never managed to figure out why ..?

Are you using a laptop ?

Which laptop are you using ?

Best Wishes

Snoopy.


I'm using laptop Acer aspire 4925.

I have tried using external web cam through usb serial and it works. but when I tried using webcam from my laptop, it appeared black screen.

thanks
Was This Post Helpful? 0
  • +
  • -

#12 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 710
  • View blog
  • Posts: 2,033
  • Joined: 20-March 10

Re: creating GUI with VIDEO CAMERA background

Posted 08 May 2012 - 12:53 AM

Yeah Acer is one of the laptops that
Seem to have this problem it was just
Supposed to be a basic webcam tutorial
And it uses the old api there is a newer
Webcam api which does not have this
Problem.

I will really have to get round to writing
A new webcam tutorial with the new api
But unfortunately I have been working
A lot of hours lately and have no spare
Time, I have young kids as well and they
Take up most of my time at weekends too .

I browse DIC now again on my iPhone now
and try to answer questions like yours.

But as I say I have little spare time.

Best Wishes.

Snoopy.
Was This Post Helpful? 0
  • +
  • -

#13 deduu10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 01-May 12

Re: creating GUI with VIDEO CAMERA background

Posted 08 May 2012 - 08:00 AM

View Postsnoopy11, on 08 May 2012 - 12:53 AM, said:

Yeah Acer is one of the laptops that
Seem to have this problem it was just
Supposed to be a basic webcam tutorial
And it uses the old api there is a newer
Webcam api which does not have this
Problem.

I will really have to get round to writing
A new webcam tutorial with the new api
But unfortunately I have been working
A lot of hours lately and have no spare
Time, I have young kids as well and they
Take up most of my time at weekends too .

I browse DIC now again on my iPhone now
and try to answer questions like yours.

But as I say I have little spare time.

Best Wishes.

Snoopy.


well, thanks for your kindness to answer my questions. Actually I'm just a beginner who want to learn something that catch my interest. If you don't mind, please tell me if you have successfully fix that problem. thank you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1