[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => slaingod [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> attachCamera issue: Tiny size - Macromedia Flex General Discussion

attachCamera issue: Tiny size - Macromedia Flex General Discussion

I'm having a weird issue. I have a Proof of Concept app that had issues with the video area for a live camera showing at 10x10 on both a Mac & PC. I was able to use scaleX/scaleY to make it a reasonable size, but the quality suffers somewhat (it is better than 10x10 simply resized, but moderate pixelation). I eventually switched my code around a little and got things to work (no idea what fixed it). Now I am seeing the same behavior in the same code in the full application. Was wondering if anyone had any ideas. private ...

  1. #1

    Default attachCamera issue: Tiny size

    I'm having a weird issue. I have a Proof of Concept app that had issues with
    the video area for a live camera showing at 10x10 on both a Mac & PC. I was
    able to use scaleX/scaleY to make it a reasonable size, but the quality suffers
    somewhat (it is better than 10x10 simply resized, but moderate pixelation). I
    eventually switched my code around a little and got things to work (no idea
    what fixed it). Now I am seeing the same behavior in the same code in the full
    application. Was wondering if anyone had any ideas.



    private function onConnectWebcam():void {
    camera_status.text = "";
    if (Camera.names.length > 0 && video == null)
    {
    if(Camera.names.length > 1) {
    // show camera chooser
    }
    // but always connect to default
    onCameraChoosen(Camera.names[0]);
    }
    else
    {
    camera_status.text = "No webcam was found. Please connect a webcam and try
    again.";
    }
    }

    private function onCameraChoosen(camName:String):void {
    onDisconnectWebcam();
    videoHolder = new UIComponent();
    cam = Camera.getCamera(); //(camName) Always connect to default per Adobe
    Docs
    if(cam) {
    cam.addEventListener(StatusEvent.STATUS, attachHandler);
    cam.setMode(480, 360, 30);
    video = new Video(cam.width, cam.height);
    video.attachCamera(cam);
    videoHolder.addChild(video);
    // I HAVE TO SCALE HERE TO GET 10x10 to work
    videoHolder.scaleX = 48;
    videoHolder.scaleY = 36;
    video_canvas.addChildAt(videoHolder,0);
    } else {
    camera_status.text = "Unable to connect to webcam. Perhaps it is busy?";
    }
    }


    Here is the mxml portion its own component. The video_canvas is the container
    for the videoHolder component:
    <mx:Canvas id="webcam" visible="false" y="64" x="14">
    <mx:Canvas backgroundColor="#FFFFFF" width="500" height="380">
    <mx:Canvas id="video_canvas" width="480" height="360" x="10" y="10"
    backgroundColor="#000000" clipContent="true"/>
    <mx:Image id="webcam_image" width="480" height="360" x="10" y="10"/>
    <mx:Text id="camera_status" color="#FFFFFF" x="88" y="88" width="310"
    height="182" fontSize="20" textAlign="center"/>
    </mx:Canvas>
    </mx:Canvas>


    This is the WORKING proof of concept code, which I can't really tell has any
    differences, other than nesting of the video_canvas:
    private function onComp():void {

    if (Camera.names.length > 0)
    {
    videoHolder = new UIComponent();
    cam = Camera.getCamera();
    cam.setMode(480, 360, 30);
    video = new Video(cam.width, cam.height);
    video.attachCamera(cam);
    videoHolder.addChild(video);
    video_canvas.addChild(videoHolder);
    }
    else
    {
    trace("User has no cameras installed.");
    }
    }
    <mx:Application...
    <mx:Canvas id="video_canvas" height="360" width="480" clipContent="true"/>

    slaingod Guest

  2. #2

    Default Re: attachCamera issue: Tiny size

    I've actually narrowed it down to a single thing: Adding any VideoDisplay
    component bugs out the camera. Anyone else ever seen this or know of a
    workaround?

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    creationComplete="onComp()"
    >
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.FaultEvent;
    import mx.controls.Alert;
    import mx.rpc.events.ResultEvent;
    import mx.core.UIComponent;

    private var cam:Camera;
    private var video:Video;
    private var videoHolder:UIComponent;

    private function onComp():void {

    if (Camera.names.length > 0)
    {
    videoHolder = new UIComponent();
    cam = Camera.getCamera();
    cam.setMode(320, 240, 30);
    video = new Video(cam.width, cam.height);
    video.attachCamera(cam);
    videoHolder.addChild(video);
    video_canvas.addChild(videoHolder);
    }
    else
    {
    trace("User has no cameras installed.");
    }
    }


    ]]>
    </mx:Script>

    <mx:Canvas id="video_canvas" height="240" width="320" clipContent="true"/>

    <mx:VideoDisplay /> <!-- Remove this line and the problem goes away -->

    </mx:Application>

    slaingod Guest

  3. #3

    Default Re: attachCamera issue: Tiny size

    Looks like plain old
    VideoDisplay.attachCamera works here...it is the combo of the 2 that s
    things up. I originally switched to just Video because I was seeing the same
    thing with VideoDisplay...weirdness. Maybe two different problems, because I
    did reinstall my cam drivers after switching to vid.

    slaingod Guest

Similar Threads

  1. AttachCamera
    By west_one in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 13th, 01:10 AM
  2. Page size issue.
    By palaksha@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 1
    Last Post: April 8th, 10:36 AM
  3. Tiny, wrong size, PDF images
    By colin_ej_clarke@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: November 1st, 03:30 PM
  4. EPS size issue
    By Chris J in forum Macromedia Freehand
    Replies: 0
    Last Post: April 22nd, 06:10 PM
  5. (Tiny) Size issues with laptop WUXGA screen
    By rkach webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 7th, 11:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •