naming of the recorded files

I recently put in place a screenshot function in my application, but currently it only saves 1 image & crushes every time

.title("Shar QImage image = QImage::fromData(array, "BMP");
    QFile outFile("shared/photos/TestImage.jpeg");
    outFile.open(QIODevice::WriteOnly);
    image.save(&outFile, "JPEG");

is it possible to save it under a different name each time

ex: TestImage01.jpeg, TextImage02.jpeg

You want to go there, but not quite.  Basically, the buffer will have the last string you give it in this loop, which is as you say 9... (In the same goes for the buffer back... to the last channel that would be 1 (i > 0))...

More like:

int fileCounter = 1; // Global declaration somewhere

sprintf(buffer, "shared/photos/image%d.jpeg", fileCounter++);
QImage image = QImage::fromData(array, "BMP");
QFile outFile(buffer);
outFile.open(QIODevice::WriteOnly);
image.save(&outFile, "JPEG");

So whenever this piece of code is passed through the fileCounter will be incremented when it is used. Thus, for example, the 2nd travel this code, fileCounter == 2... Race 3 by fileCounter is 3... etc.

Tags: BlackBerry Developers

Similar Questions

  • I can't find the recorded files recently in my document folder

    I can't find the recorded files recently in my document folder

    Maybe not save them there.

    Assuming that you have saved the today, go to the Finder, type 'Today' in the oval at top right.

  • Automatic naming of the PDF files of the data file

    I am new to scripting but have a question. What script can I use to make use of one of the fields that will be (name) and allows to name the file when it is exported?

    I found this script, but when I run it I get "null is not an object" from line 23, column 1.  I have the .csv file and a folder named "pdfs" on my desktop. In the script, I replaced "fichier.csv" with the name of my file. The first column of my .csv file is what I intend to rename pdf files.

    var csv=File(Folder.desktop+"/fichier.csv");

    var myPDFFolder = Folder(Folder.desktop+"/pdfs");

    var names = getNamesFromCSV(csv);

    if(csv.exists && myPDFFolder.exists){
        var files = myPDFFolder.getFiles();
        if(files.length==names.length){
            for(var i=0; i<files.length; i++){
                files[i].rename(files[i].parent+"/"+names[i]+".pdf");
            }
        }
    }
           
    function getNamesFromCSV(csv){
        if(csv.exists){
            csv.open('r');
            var content = csv.read();
            var namesArr = [];
            content=content.split("\n");
            for(var j=0; j<content.length; j++){
                namesArr.push(content[j].match(/^(.[^\n]+)/i)[1]);
            }
               
            csv.close();
            return namesArr.slice(1,namesArr.length);
        }
        return false;
    }

    Hi LEngelage,

    I modified your JS code, I hope this what you expect. If go you back!

    Your CSV file of entry like this 1snapshot in screenshot below another cliché is changed the name of the file in the folder "~/Desktop/1" Office

        

    var csv=File(Folder.desktop+"/Workbook1.csv");
    var myPDFFolder = Folder("~/Desktop/1/");
    
    if(csv.exists){
         csv.open('r');
         var content = csv.read();
         var namesArr = [];
         content=content.split("\n");
         for(var j=0; j
    

    THX

    csm_phil

  • timestamp of the record - file name or where to get a data code

    Hello

    Maybe more for a Sony camcorder forum, but someone here might know.

    Being an amateur, I like doing shorts holiday and children as they grow up. (currently using PP CS3)

    Currently, contemplating the purchase of a new camera (Sony CX700 or Canon HF G10) and move from HDV to AVCHD (and CS5.5) edition.  One of those little things that I enjoyed was the day I discovered a free download, HDV Split, which allowed to appoint forwarded records (files) be appointed when recording was shot. I found this extremely useful by putting a film as well as recordings made over a long period. I could see directly in the timeline when each shot was filmed. Nice.

    How this will work in the new world (without band)? I always have easy access to code data and the day where a video was shot?

    See you soon.

    Yes, in the metadata.

  • Automatic naming of the camera files

    Hello everyone,

    Anyone know if it is possible to change the auto-naming scheme of files from camera to e. g. dsc_xxxx.jpg DDMMYYYYhhmmss.jpg?

    Hi @JayDee1282,

    To my knowledge, it is not possible to change this in a setting for the phone.

    However, I searched Google Play and found this app which seems to do what you want. I have not tested the app myself so I can't say if it works or not, but it seems to have good reviews from other users.

  • Data are lost in the recording file

    I have problem with registration in the system binaries RT

    I started the registration of the host system

    After that some time suddenly power for the RT system disappeared

    then file was created in the system of the CR, but the data is lost

    It is showing 0 bytes

    Another fact to this problem

    My understanding is that the data is written, but indexing to access data is not done until the file is closed.  Therefore, the data are not available.

    The other possible explanation would be that the data are just put into a buffer to send on the hard drive.  There is a function buffer flush.  Maybe this will help you?

  • Problem with Windows Explorer and the recorded files

    When I save files from the internet and then open the folder with Windows Explorer in the backed up files, I find that WE consider not save them on my hard drive "change" more. I know it's strange, but I tend to retain files roughly in the order that I saved them, rather than by the name of the file or anything else. So now to manually change the files in a certain way, then save them to get them organized as I want. Of course, this can become very painful and long if I have a lot of files to organize this way. My question is: How can I get Windows to consider saving a file on my HDD as change? I use Firefox and updated recently, which may be the cause of the problem.

    Hi Flingle,

    Were you able to save and access files correctly before you update Firefox?

    You can create a new folder & try to download the file inside of Internet Explorer & check if the problem persists.

    Hope the helps of information. Please post back and we do know.

    Concerning
    Joel S
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Photoshop colors are more saturated than the recorded files

    I use Photoshop CC 2015 free trial on Windows 10.  I edit my pictures, how I wish, but when I save and view them without photoshop, the colors have changed: they are less saturated and more yellow.  When I bring them in photoshop on that color back how I initially edited.  This was never a problem for me before - I usually use Photoshop 7.0, but even if it does not work at the moment.  Is this a problem with how I save my files? Or a problem with the Windows Photo Viewer?

    Hello

    Well it is because of the difference in the color profile.

    You need to calibrate your machine.

    Also, here's how you can check.

    Open PS

    Click on Edit - > color settings

    Your other software can have the sRGB profile and photoshop can have ProPhotoRGB.

    You can try changing the color profile and you will see the difference

    ~ Jitendra

  • How to get to 'leave the event' script to run again when the form with the data file is reopened?

    I've created an Adobe Dynamic XML using LiveCycle Designer form with many fields / subforms that are 'visible' or the 'hidden' according to the selected options of different menu drop-down lists. Also, the form has been activated to save. Users can successfully fill out the form and save a copy with the data that has been entered.

    The problem I have is that when the recorded file is opened again in the 'hidden' fields / subforms that were previously made visible by selecting the appropriate options in the drop-down list NOT displayed now. However if you make the same selections from each of the drop-down list shows still hidden ONCE the fields / subforms are displayed, and do not contain data that has been entered.

    The problem seems to be that the script that determines whether a field / subform is 'hidden' or 'visible' is a

    "<event activity="output" name="event__exit">" "

    that is followed by

    If (this.rawValue is '0')- (i.e. the value of the drop-down list)

    sfCompanyDetails.presence = "visible";

    sfRecruitmentAgency.presence = 'hidden ';

    etc, etc.

    and, therefore, it is not executed again when the file is reopened.

    Can someone advise please how do I do this?

    Hello

    Check if you enabled the "auto" option to keep the script changes in the properties of the form.

  • where are the audio files stored during recording as a project?

    Where are the audio files stored during recording as a project. The project opens fine on my computer, but when I move to another computer I have missing audio files.

    They are stored in their own folder in the project folder:

    So if you want to move it to another computer, you must copy the project folder, not only of the project folder.

  • Firefox asks me if I would record the same file repeatedly

    Firefox repeatedly asks me if I want to save the same file. I delete the downloads.sqlite file. I disabled "don't forget the download history. I've upgraded Firefox 7 to 8 Firefox. Still having the same problem. I did uninstall and reinstall Firefox. I deleted the file from my computer. I still have the same problem. Problem only when Firefox is running.

    I am running Windows Vista Home Premium with Service pack 2 (32 bit).
    

    Suggestions how warns we stop/small window pop up that says "you have chosen to open...". You want to save this file?

    Problem seems to be related to the use of speed dial add-on for FF. Some of the documents stored in the speed dial repeatedly ask you to record files/programs.

  • I am trying to record an mp3 file, but firefox does not allow me to save... it allows me to read the file but not download and asave to my computer. How can I enable to save the mp3 files on my computer?

    I am trying to record an mp3 file, but firefox does not allow me to save... it allows me to read the file but not download and asave to my computer. How can I activate the Firefox save MP3s on my computer?

    Go to Options > Applications tab > MPEG Layer 3 audio(audio/mpeg) image search > use the "Save file" option on the menu drop down.

  • In the Photos of El Capitan how to record a double published in a separate with its own name and the ID file file?

    In the Photos of El Capitan how to record a double published in a separate with its own name and the ID file file?

    Only by exporting - with Photos (and iPhoto and Aperture) - you can have several versions of an image by duplicating the image (control - D), but this does not create an image file separated until you export - it creates a separate edit list in the database that applies to the original when you watch or export the photos

    Photos as it were its predecessors is a non-destructive control Digital Asset Manager (DAM) which does not any changes to files in the database but built a list of validation

    LN

  • How to add ID/batch number in the naming of the batch summary report and STD files generated by the sequence editor of

    Hello

    How to add an Id(which is inputted in the Configure Lot Setting) a lot in the naming of the batch summary and report STDF files generated by the Test Module of the semiconductor.

    Currently the default name is shown in the excerpt below

    Thank you

    Rovi

    Hi Rovi,

    Have you tried the recall of ConfigureLotSettings or some of the steps listed in Cusomizing behavior for batch parametersof edition?

    Kind regards

    John Gentile

    Engineering applications

    National Instruments

  • Open to create problems replace with the recording of file templates

    Hello, I had a problem with the function open/replace/create. Could you please specify each function, how it works? As you can see in my file, I try to record in the specified path. The values appear in the text file, but when I change some values in the course of data, it replaces the old value, it has been. I want to have all the data in a single file until I close and open another file for the operation.

    How can I do?

    Thank you

    I think that its programming in-> file-> advanced file io

Maybe you are looking for

  • Lagayet Battlefield 3 game

    Game works with outages what to do?

  • Order recovery media for HP Probook 4540 s

    Hard drive failed shortly after the warranty ended and cannot find the recovery media for the laptop. Windows 7 Pro 64-bit Product C9K70UT number

  • Problemas con windows install

    Means - This is a foro Público para as nunca publicar information privada como el correo electronico o phone numbers! Ideas: Programs are having problemas con Error messages Los recent changes made in su equipo What is han intentado did el problema

  • BlackBerry Smartphones Caller ID works sometimes

    I have Curve 8330 and I have problems with caller ID.  It works when it wants too.  People who call me are in my address book, so when they call me their names should appear, but most of the time they are not - only randomly. Why?

  • Fixed: WebClient Service does not start

    For the error event: "'VMware vSphere Client Web service stopped with the error service particular incorrect function" "Here's how I solved it:I figured it thx for this guy: vSphere 5.1 Web Client: Service error of | vmwiz <-well, _he_ figured it...T