Resizing at runtime bitmap led to empty graph

Hi all

I'm having the darndest time to find how to create thumbnails dynamically during execution. Here is the code I have:

<?xml version="1.0" encoding="utf-8"?>


<mx:Module

 xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="

library://ns.adobe.com/flex/spark" xmlns:mx="

library://ns.adobe.com/flex/mx"width="

100%" height="

100%"
layout="
vertical">

<fx:Declarations>

</fx:Declarations>

<fx:Script>
<![CDATA[

import flash.sampler.NewObjectSample;


import flashx.textLayout.events.SelectionEvent;


import mx.collections.ArrayCollection;

import mx.controls.Image;

import mx.controls.ProgressBarMode;

import mx.core.IUIComponent;

import mx.events.DragEvent;

import mx.events.ItemClickEvent;

import mx.graphics.codec.PNGEncoder;

import mx.managers.DragManager;

import mx.modules.ModuleLoader;

import mx.utils.Base64Decoder;

import mx.utils.Base64Encoder;


import spark.components.Window;

import spark.events.IndexChangeEvent;

import spark.primitives.Rect;



private var _fileReference:FileReference;

private var _fileTypeFilter:FileFilter;

private var _fileLoader:Loader;




protected function btn_files_clickHandler(event:MouseEvent):void{

this._fileReference = new FileReference();

this._fileTypeFilter = new FileFilter("Typical Genealogy Source Files", "*.pdf;*.doc;*.jpg;*.jpeg;*.png;*.gif");

this._fileReference.addEventListener(Event.SELECT, fileSelectHandler);

this._fileReference.addEventListener(ProgressEvent.PROGRESS, loadingHandler);

this._fileReference.addEventListener(Event.COMPLETE, loadPictureHandler);

this._fileReference.browse([this._fileTypeFilter]); }



private function fileSelectHandler(event:Event):void{

this._fileReference.load();}



private function loadingHandler(event:ProgressEvent):void{

this.prb_fileUplaods.setProgress(event.bytesLoaded / event.bytesTotal * 100, 100);

trace((event.bytesLoaded / event.bytesTotal * 100).toString() + " precent loaded.");}



private function loadPictureHandler(event:Event):void{

this._fileLoader = new Loader();

this._fileLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, pictureLoadedHandler) ;

this._fileLoader.loadBytes(this._fileReference.data) ;}



private function pictureLoadedHandler(event:Event):void{

var original:BitmapData;

var bmd:BitmapData = Bitmap(event.target.content).bitmapData;

var originalWidth:Number = Bitmap(event.target.content).loaderInfo.width;

var originalHeight:Number = Bitmap(event.target.content).loaderInfo.height;

var m:Matrix = new Matrix();
m.scale(100/originalWidth, originalHeight/100);
original = 

new BitmapData(100, 100); original.draw(bmd, m);


this.img_test.source = bmd.getPixels(bmd.rect);
}


]]>


</fx:Script>


<mx:ProgressBar id="prb_fileUplaods" labelPlacement="center" height="20" mode="{ProgressBarMode.MANUAL}" />

<s:Button label="Choose File(s) ..." id="btn_files" height="20" click="btn_files_clickHandler(event)" />


<mx:Image id="img_test" />
</mx:Module>

</mx:Modu<






No idea what I am doing wrong?

Thank you very much for all the help, I was challenging my brain with this wall of brick for the last two weeks!

~ Mike

Hello

the following works, note that if you upload an image, you must convert the bitmapdata to an image format (I did it for you) you just need to add the download to.

David.

http://ns.Adobe.com/MXML/2009"xmlns:s ="library://ns.adobe.com/flex/spark ".

xmlns:MX = "library://ns.adobe.com/flex/mx" >

Import mx.controls.ProgressBarMode;

Import mx.graphics.codec.JPEGEncoder;

private var fi: FileReference = new FileReference();

private var ff: FileFilter = new FileFilter ("images", "*.jpg; *.gif; *.png");

private var fl:Loader = new Loader();

protected function btn_files_clickHandler(event:MouseEvent):void

{

fi.addEventListener (Event.SELECT, fileSelectHandler);

fi.addEventListener (Event.COMPLETE, loadPictureHandler);

fl.contentLoaderInfo.addEventListener (Event.COMPLETE, onComplete);

fi. Browse ([FF]);

}

private void onComplete(event:Event):void

{

var originalWidth:Number = event.currentTarget.content.loaderInfo.width;

var originalHeight:Number = event.currentTarget.content.loaderInfo.height;

var m:Matrix new matrix());

var scale: Number = originalWidth/100;

m.Scale (scale, scale);

var newBmD:BitmapData = new BitmapData(100,originalHeight*scale);

newBmD.draw (event.currentTarget.content.bitmapData, m);

var ba: ByteArray = new ByteArray();

var Encoder: JPEGEncoder = new JPEGEncoder (100);

BA = encode. Encode (newBmD);

img_test1.source = ba;

}

private void fileSelectHandler(event:Event):void

{

fi. Load();

}

private void loadPictureHandler(event:Event):void

{

img_test4.source = fi.data;

fl.loadBytes (fi.data);

}

]]>

Tags: Flex

Similar Questions

  • Solution to resize properly transparent bitmaps

    Hello everyone,

    Recently, I tried to use Bitmap.scaleInto () to resize the transparent bitmap images in my application. Although this feature is a nice addition to JDE 5, it tends to produce bad results on the transparent bitmaps such as PNG24 files. The Forum posts that I found on the web for this problem talk using Bitmap.createAlpha () which restores transparency, but still produces artifacts in the final bitmap as the white edges and colours of the wicked pixels.

    To resolve this problem without the use of an external library, I created the following function. He always uses scaleInto(), but in a different way. I added some comments in the service and created a screenshot showing the results before and after (don't worry about the photos, they are a part of this project, I am working currently on). I write the result here in the hope that it will help others looking to achieve the same thing. The code has been tested in JDE 5 and 6 of JDE and the sample photos have been created using different combinations of types of filters and reports l / h.

    package com.patchou.ui;import net.rim.device.api.system.Bitmap;import net.rim.device.api.ui.Color;import net.rim.device.api.ui.Graphics;/** * * @author    Patchou * @version   1.01 * */public class GPATools{    /**     * Resizes a bitmap with an alpha channel (transparency) without the artifacts introduced     *   by scaleInto().     *     * @param bmpSrc        Source Bitmap     * @param nWidth        New Width     * @param nHeight       New Height     * @param nFilterType   Filter quality to use. Can be Bitmap.FILTER_LANCZOS,     *                           Bitmap.FILTER_BILINEAR or     *                           Bitmap.FILTER_BOX.     * @param nAspectRatio  Specifies how the picture is resized. Can be     *                           Bitmap.SCALE_TO_FIT,     *                           Bitmap.SCALE_TO_FILL or     *                           Bitmap.SCALE_STRETCH.     * @return              The resized Bitmap in a new object.     */    public static Bitmap ResizeTransparentBitmap(Bitmap bmpSrc, int nWidth, int nHeight, int nFilterType, int nAspectRatio)    {        if(bmpsrc== null)            return null;
    
            //Get the original dimensions of the bitmap        int nOriginWidth = bmpSrc.getWidth();        int nOriginHeight = bmpSrc.getHeight();        if(nWidth == nOriginWidth && nHeight == nOriginHeight)            return bmpSrc;
    
            //Prepare a drawing bitmap and graphic object        Bitmap bmpOrigin = new Bitmap(nOriginWidth, nOriginHeight);        Graphics graph = Graphics.create(bmpOrigin);
    
            //Create a line of transparent pixels for later use        int[] aEmptyLine = new int[nWidth];        for(int x = 0; x < nWidth; x++)            aEmptyLine[x] = 0x00000000;        //Create two scaled bitmaps        Bitmap[] bmpScaled = new Bitmap[2];        for(int i = 0; i < 2; i++)        {            //Draw the bitmap on a white background first, then on a black background            graph.setColor((i == 0) ? Color.WHITE : Color.BLACK);            graph.fillRect(0, 0, nOriginWidth, nOriginHeight);            graph.drawBitmap(0, 0, nOriginWidth, nOriginHeight, bmpSrc, 0, 0);
    
                //Create a new bitmap with the desired size            bmpScaled[i] = new Bitmap(nWidth, nHeight);            if(nAspectRatio == Bitmap.SCALE_TO_FIT)            {                //Set the alpha channel of all pixels to 0 to ensure transparency is                //applied around the picture, if needed by the transformation                for(int y = 0; y < nHeight; y++)                    bmpScaled[i].setARGB(aEmptyLine, 0, nWidth, 0, y, nWidth, 1);            }
    
                //Scale the bitmap            bmpOrigin.scaleInto(bmpScaled[i], nFilterType, nAspectRatio);        }
    
            //Prepare objects for final iteration        Bitmap bmpFinal = bmpScaled[0];        int[][] aPixelLine = new int[2][nWidth];
    
            //Iterate every line of the two scaled bitmaps        for(int y = 0; y < nHeight; y++)        {            bmpScaled[0].getARGB(aPixelLine[0], 0, nWidth, 0, y, nWidth, 1);            bmpScaled[1].getARGB(aPixelLine[1], 0, nWidth, 0, y, nWidth, 1);
    
                //Check every pixel one by one            for(int x = 0; x < nWidth; x++)            {                //If the pixel was untouched (alpha channel still at 0), keep it transparent                if(((aPixelLine[0][x] >> 24) & 0xff) == 0)                    aPixelLine[0][x] = 0x00000000;                else                {                    //Compute the alpha value based on the difference of intensity                    //in the red channel                    int nAlpha = ((aPixelLine[1][x] >> 16) & 0xff) -                                    ((aPixelLine[0][x] >> 16) & 0xff) + 255;                    if(nAlpha == 0)                        aPixelLine[0][x] = 0x00000000; //Completely transparent                    else if(nAlpha >= 255)                        aPixelLine[0][x] |= 0xff000000; //Completely opaque                    else                    {                        //Compute the value of the each channel one by one                        int nRed = ((aPixelLine[0][x] >> 16 ) & 0xff);                        int nGreen = ((aPixelLine[0][x] >> 8 ) & 0xff);                        int nBlue = (aPixelLine[0][x] & 0xff);
    
                            nRed = (int)(255 + (255.0 * ((double)(nRed-255)/(double)nAlpha)));                        nGreen = (int)(255 + (255.0 * ((double)(nGreen-255)/(double)nAlpha)));                        nBlue = (int)(255 + (255.0 * ((double)(nBlue-255)/(double)nAlpha)));
    
                            if(nRed < 0) nRed = 0;                        if(nGreen < 0) nGreen = 0;                        if(nBlue < 0) nBlue = 0;                        aPixelLine[0][x] = nBlue | (nGreen<<8) | (nRed<<16) | (nAlpha<<24);                    }                }            }
    
                //Change the pixels of this line to their final value            bmpFinal.setARGB(aPixelLine[0], 0, nWidth, 0, y, nWidth, 1);        }        return bmpFinal;    }}
    
    
    
    

    Here's an example of how to call the function:

    Bitmap bmp = Bitmap.getBitmapResource("picture.png");Bitmap bmpResized = GPATools.ResizeTransparentBitmap(bmp, 30, 60,    Bitmap.FILTER_LANCZOS, Bitmap.SCALE_TO_FIT);
    

    Here is the result:

    Let me know if you find this useful, all comments are appreciated .

    Cyril

    Thank you . I made a minor adjustment to the code (to check if the size of the original image is identical to the desired size). For some reason, I can't edit my original post that I posted the latest version on my blog. Links: http://www.patchou.com/2010/10/resizing-transparent-bitmaps-with-the-blackberry-jde/ .

    Moderator note: I've updated the code in the original post to match the latest version.

  • use runtime bitmap caching?

    What is the feature of the property 'use bitmap caching duration' used for? mousing over the box gives an explanation, as I understand it, but I don't know why you would use it. I think it can help with a problem, I'll have too and wanted to check with you guys to see what do use you it and the consequences, if any, of its use.

    I have video clips that have the images loaded in them to an xml file. MC1 is on the scene, frame 1, with an instance name of mc1. in the layer actions of this framework, my script loads an image in the clip via an xml file. all the works of the fine and good. now in part 2 I want to reposition mc1 in the same position that mc2 is located. whenever I have copy the instance of the previous image, then re - manually position it... It's all still right, images of charge very well. However, whenever I just rename the name of the instance to mc1 mc2, the image is not loaded in the clip? Why not?

    It is more intuitive to think of the angle of inclination. so, if you want to tilt the values of x by ang use mat.c = Math.tan (ang). If you want to tilt the values of y by ang use mat.b = Math.tan (ang).

  • Resize the array element programmatically

    Hi, I need to programmatically resize the element of a matrix. The external framework of the matrix control must take the same size, but the internal element should chang size programmatically.

    I have found no property/method to do this. Wait using Xcontrol I guess.

    Any idea?

    Thank you.

    Of your image that you inserted, I guess your "matrix" is a display of 2D LED array.

    In order to resize these elements all in now the 'original size of the matrix", you must implement two steps:

    1 resize LEDs:

    • Get ArrayElement reference

    • Convert the reference to Boolean

    • Set the width and height for the Boolean value of the new value

    Please note that now change the size of all THE LEDs. This is because all items in a table share the same properties (including size) with the exception of the "Value" property

    In addition, the table shell is resized as it still shows the same amount of LEDs (columns, rows)

    2. calculate the new number of columns/rows to keep the table shell roughly the same size

    • Calculate the multiplier for resizing in each direction (led to half size smaller multiplier of 2 to the number of lines/columns each)

    • Multiply the number of rows/columns of this multiplier (rounded)?

    • Set the size property of dimension to the hull of the array to the new values

    Please note that this will be 'resize the table to about the same size as it did before. Resizes rounding issues very likely (it has no LED 0.5 available!)

    Norbert

  • Draw text on the XY graph

    Hello

    There is a technique to draw a text note on graph XY.

    For example the text "AAAAAA" put near the upper left of the XY graph.

    Thank you.

    Previous version is wrong: this only works if an annotation already exists on the chart.

    If no annotation it does not work.

    Here is the solution for the empty graph:

  • Reliablity and performance monitor is empty

    I was just playing on Vista, now that I finally got and decided to launch the performance and reliability monitor to see why my computer was using up to 1.6 GB of RAM at idle. Not that she really bothers me or hurts my performance of the computer (after x 64 windows and 6 GB of RAM), but after opening it, I was a little confused because nothing was actually happening. I went to the monitor tab, you press start, but who have done nothing. I also tried to pass through the computer management program, but the same exact results. The work of monitors of reliability and performance, but the main screen, which shows the performance used by individual programs won't give me empty graphs, of the options and outcomes - although lack of. Any help would be great.

    This is just a screenshot of what happens:
    http://i562.Photobucket.com/albums/SS68/ThuggyWuggy/NewBitmapImage.jpg

    Well, I did everything what should have made the monitor, at least, I don't think that I did... the only thing that I changed the activation cool no silent mode for my CPU on my motherboard options, so I would not use too be able to leave my computer on all night. The monitor now works... If it stops working again, I'll post, but that seems to have been the cause. (?) It seems weird to have solved anything, but w/e... I do not know... I don't understand. I'll leave it is open for a day to make sure that it is the question. If this is the problem my motherboard is a version of Platinum bios msi k9a2 1.4, so others know how to solve this problem.

  • problem of writing bitmap

    I have a bitmap to write, this is the code I use:

            // array is my 0-1 indicator matrix
            int[] imgdata = new int[width*height];
            Bitmap bitmap  = new Bitmap(width, height);
            for (int y = 0; y < height; y++) {
                for (int x = 0; x< width; x++){
                    if (array[y][x] == 0)
                            imgdata[y * width + x] = 0x00FFFFFF;
                    else
                            imgdata[y * width + x] = 0x00000000;
                    }
            }
    
    bitmap.setARGB(imgdata, 0, width, 0, 0, width, height); //if visualize it is white~~~
    
    // resize to large bitmap
    
            Bitmap retmap = new Bitmap(5*width, 5*height);
            bitmap.scaleInto(retmap, Bitmap.FILTER_BILINEAR, Bitmap.SCALE_TO_FIT);
            return retmap;
    

    But the image turn out to be like this:

    I want only the transparent matrix but it gives me a blurred image.

    Anyone know how to convert a 0-1 matrix to a bitmap and resize this blur without it?

    Sorry, I can't see your picture...

    and I think that the tour is intended to make white becomes black and black becomes white, is it?

    I think the blur effect, it is because you put across the 5 times larger and using Filter_bilinear...

    try to read in wiki article abou image resizing

    http://en.Wikipedia.org/wiki/Image_scaling

  • How to upgrade the graphics card with t500 20896kg

    Hello

    I've been misled by some tests to the conclusion, that all the t500 would have this incredible "switchable graphics" and Announces. Ruse, simply create a good product and then 70 different versions with a lot less stuff inside - everyone will buy it, which is not a complete hardware nerd and knows all the numbers and things. In any case, I'm the fool who bought the T500 WITHOUT any graphics at all because Intel x4500HD is obviously not the use of a graphics card, he just pretended a. Not Fallout 3, no 'empty' (graph sucks pretty well, even if no laptop with an older map should have problems with it), no nothing.

    It doesn't mean ANY modern game at all, 771,2 Mo 'RAM' Intel X4500HD or not - you know before or pay huge sums for games that do not work have Forum-Nerds laugh their bootys away on a silent client who fell the tricks of Lenovo (and Intel).

    Yes, rantings side: is it possible to upgrade the T500 20896 kg - that goes without graphics card - with a real graphics card, would be the choice to choose and how do I insert it?

    Thank you

    PS: by the way, someone had some effort with this lenovo-windows-update action? has attracted money, never had no reminder or shipping.

    Nichtidentische wrote:

    So I can't install a graphics card in a docking station? I've heard, the docking station for the thinkpads Lenovo offer a slot for graphics cards, but I don't know if that would be sufficient for the games and if it works at all.

    It won't be enough for the games, this beneficial configuration for those wishing to connect multiple monitors to their thinkpads.

    Nichtidentische wrote:

    Another question: if I sell mine, I have to buy a higher resolution screen if I decrease the resolution to a degree which allows ergonomic office work? And what exactly is the LED backlight? Is this really a LED monitor or just some add-on fancy?

    Laptop monitors the work of the best on the native resolution, but it will not be so bad. Backlit by LED is not a fancy add-on, your cell phone screen is an example of backlit, while not being used it obscures first itself, then turns off, see the procedure for good links learn what it is: -.

    http://www.PCMag.com/Article2/0, 2817,2188553,00.asp

    http://News.CNET.com/8301-17938_105-9671130-1.html

    http://en.Wikipedia.org/wiki/backlight

    It will be useful.

  • What is the most modular method to create a 'plan' generated automatically?

    I have a 'plan' that I am currently building a test at the beginning. My "plan" consists of 3 levels of the Organization; the unit, the Group and the arrangement.

    There are a few types of units that I intend to create, but I'm looking for only a few basic methods; I can shake the details in regards to specific controls, resizing, positioning, etc.

    There may be<= 4="" units="" per="">

    There are 4 positions in each arrangement; one for each possible unit.

    There may be<=20 groups="" in="" the="">

    There is only a single arrangement; the arrangement is the entire floor plan.

    Each unit is composed of some Boolean LEDs, progress bars, graphs of waveform and digital indicators.

    Each group is simply an arrangement of units; with an indicator of string as a label.

    The arrangement (floorplan itself) is just an arrangement of groups.

    I considered simply create typedefs for each control so that I can change or resize each if necessary control and have the changes automatically cascading, but is there a way for me to create a typedef for each unit, although it contains several controls? Within the unit, all controls will have a size and position, so it would be nice to be able to resize and rearrange the controls in the unit and have all these changes cascade to all units. It would also avoid having to define the positions of each control for each unit (I could just define the position of each unit).

    I've attached a screenshot of the arrangement (floorplan) .jpg because it currently displays. You can see that inside, there are 8 groups (labeled SX #) and 4 groups of different type (labelled RC #). Within each group, SX, there are 3 units (with a color box gray placeholder where a 4th unit could display).

    I know my questions can be very basic and obvious to experts on this forum, but I have very little training LV, so I am left to my own here.

    Thank you for taking the time to read my message; I hope it is at least as clear as mud.

    You can create a definition of a cluster type and a cluster can contain several data types.  That answer your question?

  • Redundant (and wrong?) ADDED_TO_STAGE events

    I'm always in the middle of this diagnosis, but thought others might have seen, or it may stick to an explanation possible for problems in their application, maybe just with the latest SDK or OS.  I am not sure yet that it's anything other than to hurt me, but of course, it does not match my understanding of how things are meant to work.

    I have an app with a really simple Interface, the relevant material being the root Sprite, a homepage Sprite in that and in this page a Sprite that contains the bitmap I'll call graph.  I am facing a problem at startup when the graph is two ADDED_TO_STAGE events, even if it is NOT added multiple times or removed.

    I put things up by adding an ADDED_TO_STAGE listener to each class constructor.  In the root of the ADDED_TO_STAGE sprite, I build the main page and addChild(), which leads to get an ADDED_TO_STAGE (immediately).  In this handler, I build the graph (and much more) and addChild(), if she then gets an ADDED_TO_STAGE (immediately) as well.  All fine so far... it's like things "should" work.

    Unfortunately, upon return to the home page Manager ADDED_TO_STAGE, the graph becomes another ADDED_TO_STAGE parasite even though she is already in the stage's display list and was not REMOVED_FROM_STAGE in the meantime.  This sequence all occurs within the single function call to addChild (hand) in the root of the ADDED_TO_STAGE sprite Manager, it seems to be triggered by the Flash runtime behavior and not my code.

    Worse yet, I added managers to each of these three classes to look at ADDED and REMOVED as well as versions "to_stage" of the people, and I see a lot of redundant ADDED events with no DELETED at all events.

    Then a fundamental question: I'm wrong until only a single event ADDED_TO_STAGE for a given object, if it becomes an addChild() makes up for it and its parent and so on?

    Secondly, someone has a workaround or other ideas?  I had to make the installer in ADDED_TO_STAGE managers since I can't rely on the 'stage' of any DisplayObject property given as the value down here (other than the root sprite itself).

    At present, the only option seems to be moving out of ADDED_TO_STAGE and in constructors for everything except the root sprite.  Is that really the approach typical and/or required?

    At the present time, based on what I see the SDK 1.1.0 and running on OS 1.0.6 I would say that if everyone expects only one ADDED and ADDED_TO_STAGE event, and perhaps to build large parts of their user interface in these managers, they will want to verify if they actually build duplicates of many things and possibly raise a really messed up or sluggish UI accordingly.

    If necessary, I should be able to it will shrink down to a small sample that shows the problem.  I'll hold off doing this until I hear what others have to say.  Thank you!

    (Edit: tried to change the title of the topic.)

    Oh, just found this the problem report, noting this is an official bug as well.

    Several workaround solutions, each with different disabilities, including the removeEventListener() approach, are listed.

  • What is the best all-in-one printer?

    We have been endowed with a HP Officejet 4632 years and there is no interface very well

    with our Mac.  When you use the charger, it does very well with occasional off-skew

    copies and scanned documents.

    However, when copying, scanning and resizing help flat, most of the empty time

    copies out.  When that happens, it should turn the printer power off and close

    Mac and start over.

    Are there other inkjet all-in-one printers

    I used the brother 7820N - it is an older model that makes black and white printing, but it connects beautifully on the network and reproduced faithfully what ever is sent.

    I guess the answer to your question depends on whether you need printing, what kinds of things print you color and what your budget

    There are some printers that are around 120-140 dollars if you are in the United States - try Canon or HP and are looking for discounts on stores like Best Buy or Fry

  • need help! brike S6000

    Hi every1 I have flashed my device and bad recovery image collapsed I tried to restart it I had meta and recovery mode, but the recovery screen shows these three operations: recovery, quick mode, normal mode by pressing any botton it hangs for minutes then don't reboot loop, no logo no sound screen led just empty my q is cannot I he unbrick bootable sd will do the job How? I have the stock firmware great need help please thank you

    Use this tool to install drivers for your tab. See here: -.
    http://Forum.xda-developers.com/showthread.php?t=1983470

    Using that you can install the drivers for any device. Now, I think you would be knowing how flash ROM flash SP tool. If this isn't the case, then after return.

  • NOR-USB 9229: How audio signal acquisition?

    Hello

    It's one of those stupid beginner questions I use a module OR 9229 USB to capture the audio output of my computer line as follows:

    -left line-out goes to AI0 +.

    -right line output goes to AI1 +.

    -land line out of is divided into two and goes to AI0 - and AI1 -.

    What is the correct way of wiring?

    In case it is, I have (I think) have problems audio signal acquisition. In the Measurement & Automation Explore, I creates a task for the acquisition of voltage AI0 (44100 Hz, etc.) -nothing is displayed on the graph when I run the task! (I have music running on the computer during the measurement) Otherwise, the 9229 flashes green, seems to be ok, auto test work, etc..

    Someone has an idea what I am doing wrong?

    Thank you!

    Hi acgrama,

    That sounds like it should give you a signal any (not an empty graph or a flat line at 0 V), but the USB-9229 is not very suitable for audio:

    • The USB-9229 to entry level is of +/-60 V. A line level audio signal will use a small fraction of that. Of the USB-9229 precision and plug noise are adequate for your application?
    • The USB-9229 can't acquire them exactly 44.1 kech. / s. It supports some 50 kech sampling frequencies. / s divided by a number between 1 and 31, as 50 kech. / s, 25 kech. / s, 16.7 kech. / s and so on. When you specify a sampling clock DAQmx not taking in charge, he is forced to the top supported next, which in this case is 50 kech. / s. (you can read back the SampClk.Rate property to see what DAQmx forced the rate to.) For 44.1 kHz audio to USB-9229, you will need to re - sample the acquired data (which are specific to the programming environment).

    Assuming that you're just trying to do it for learning or experimentation, here are a few ideas:

    • Is the line connector configured as an output line? Many mothers today have reassignables audio connectors.
    • The volume of the source (wave, CD, whatever) high enough?
    • On the graph, is scaling auto turned on? If you display data in a table instead, are the numbers exactly 0 or any close?
    • The output of the line works if you are connecting to another device that is designed to handle signals to line level?
    • If you connect a battery (AA, 9V, whatever) for the USB-9229 instead, read the Max supply voltage?

    Brad

  • two locks of laptop see the light as lock sign1 and lock signed and fully offshore

    Hello

    I have HP 6730 laptop computer b today, when I start it show me

    two locks light as ld (lock sign1) and (lock signed) and turns it off completely

    lock sign1 means a pic of lock with number 1

    average of locking signed a lock with a text pic

    It's not start all these two locks photo blick 2 times, then turns off completely another conduit of speakers and! and illustrated also box.

    No display at all.

    Please help what is this error?

    Thank you

    Those are the LEDs for shift caps lock and number lock. The fact that your computer does not come on and the lights flash means that the laptop trying to communicate an error code. See LED display empty Error Codes for more information.

  • Make a DrawingSurface to a WriteableBitmap in Silverlight 5

    Silverlight 5, how I made a DrawingSurface to a WriteableBitmap? I already tried to use the render method of the WriteableBitmap class and the constructor that takes a UIElement as a parameter, but the bitmap out always empty. I need a way to make the 3D scene to an image. Any help would be appreciated.

    Hi Marcio,

    I would recommend to post your question on the forums of Silverlight:
    They can help you with questions of development of Silverlight.

Maybe you are looking for

  • After standby mode Satellite L300 cannot connect to the internet

    Hello I have problems with my Satellite L300, if I put the laptop to sleep it disconnects from the internet and when I try to continue later, he said that there are no wireless networks.The only way I can connect again is to restart my laptop. Can so

  • Remove bike E Post

    How can I delete my old posts?

  • Dynamically adjust the size of table control panel

    Hello I have a combo box control that I drag within a table. Since my request depends on the size of the initialized array, I'm having a problem with the car, adjust the number of items to display on the control panel. Say for example, I wanted to ha

  • sine wave vi

    I would like to illustrate the effects of the differences on the amplitude, frequency and phase between two sine waves. I already used the sinus function and works well without phase variations. I tried to use the sine wave as planned in the signal g

  • kb2446704-uninstall folder

    kb2446704 - unlike the other regular KBs which creates $spuninst, Im a moment, look for the KB2446704 uninstall folder, this folder in C:\ is this saved Ko?