C++ :: Print Custom Area Of Screen - Save As Image File
Sep 9, 2014
I am trying to automatically(periodically) print screen a custom area of the screen, save it as an image file (the image will have the same format always), and then use OCR to get the text in the image as usable string variables. Is this doable? I was looking into tesseract OCR but I find it a bit unclear.
I'm trying to read from a header file to take the image dimensions and other variables but I don't understand how to iterate through the "key" so it saves each line.
This is what the header file will always look like:
!INTERFILE := !imaging modality := nucmed !version of keys := 3.3 ; !GENERAL DATA :=
[Code].....
Ideally it would just skip the keys that aren't wanted and keep moving through the lines. Should there be a for loop for the key (and if so, how does that work with pointers?) or should this method just be scratched...
I have an assignment to manipulate a ppm image which I'm having a lot of difficulty with and I have to have a function to print the ppm but I dont know how to send the ppm file to said function for printing.
#include "transform.h" int print(void){ int i; printf("P6 "); printf("%d %d ", g_width, g_height); printf("22 "); }
I have a text file where in each line is 3 words and 2 int type numbers. I'm doing search by word and I want to print out to the screen the whole line where that word was found (the words is repeated in some lines). My search looks like this:
Code: #include<iostream> #include<string> #include<fstream> #include<stdlib.h> #include <vector> using namespace std; int main(){ vector <string> words; string str, paieska;
I am trying to make a program that will convert a list of binary numbers from a file into decimal and print the decimal to the screen. I have no problem doing the conversion, the problem comes up when our teacher wants the input file in a format as such:
3 10110101 11111111 10101010
The first number is supposed to tell the program how many different 8bit strings it is going to have to convert, and then the following lines are those binary numbers.
I am not very experienced with file inputs, and I know how to open files and read lines in.. The problem is, how to say "ok the first line says 3, so now I have to convert the next 3 lines" . I am assuming it is just a simple loop that I am missing....
I am new to application coding as I previously coded Python. XAML. How to use a custom image I made as a background image in my program. I have searched everywhere but all there is about how to use the asset images.
so im trying to make a background for a menu, but it is only so big. its not the kind of picture where i can just reapply it. is there a function to make it fill to the screen?
Is it possible to save web page as image with web application? if yes then how?.I searched and searched and searched but all examples i found were for windows application and i'm facing lot of trouble while converting it for web application.
I was trying to capture entire web screen and save as .jpeg format.
So far I have done this using C# Windows Application.
Same thing I am willing to do in 'VC++ 2010 Win32. In my C++ project I have created a Toolbar with a button on IE 9 browser. And on Toolbar button click I can print current window.
But I don't know how to take a snapshot and save to specified directory in .jpeg format using VC++ 2010. I have Windows 7.
I am developing an app that shows a pixelated picture in a window. I am trying to capture the image, which is composed of a number of tiles processed from a mother image, but I am having difficulty since I can't reference the image on the screen. I have placed a rectangle around the image and my understanding is that I have get the window handle for the rectangle in order to save the Image as a jpg file. In the literature there is something about a Device Context and a window handle but my compiler throws out HWND and I don't really understand the device context. I am using Windows Forms, not native code.
I am trying to develop a GUI using MFC, but I am having trouble using CFiledialog to save a file. The problem is, the file is not getting saved to the folder when I use the CFiledialog. Below is the code I am using.
Numbers are 3d6 Rolling die no.1... RolledDie: 4 DieTotal: 4 Rolling die no.2... RolledDie: 5 DieTotal: 9 Rolling die no.3... RolledDie: 5 DieTotal: 14
How to print to the screen the value of n after it has been multiplied.
For example: if I use cout << "n: " << n << " power: " << power << " "; I
can see the variable "power" decrementing by 1, but I don't see the variable "n" incrementing with its new value after it has been multiplied by n * n.
#include <iostream> using namespace std; typedef unsigned short int USHORT; typedef unsigned long int ULONG;
fstream infile1(argv[1]); if(!infile1.is_open()) cout << "Could not open file"; else { char listNum; while(infile1.get(listNum)) cout << listNum; }
However, when I check for odd or even numbers it will check each and every number.
printed like this (partial list): 1 is odd 3 is odd 8 is even 9 is odd
But it should print: 138 is even 9 is odd
I tried using getline, but it keeps giving me the errors: invalid conversion from 'void*' to 'char**' invalid conversion from 'char' to 'size_t*' too few arguments to function 'ssize_t getline(char**, size_t*, FILE*)'
Here is the getline code, what am I doing wrong? I have tried switching things around, adding things. Just nothing works.
ifstream infile1(argv[1]); if(!infile1.is_open()) cout << "Could not open file"; else { char listNum; getline(infile1, listNum); cout << listNum; }
Given this sentence as an input: "Hello my name and "John" (with its spaces and capital letters), print it on the screen .. NB the phrase must be entered from the keyboard all at once ... you can do this in C / C + +?
I'm trying to write a program that prints all of the prime numbers to the screen. I'm getting angry because it only prints EVERY number. I think it has something to do with the bool change not being able to leave the for-loop but how to fix it.
Code: #import <stdio.h> #include <stdbool.h> int main(void){ printf(" The Primes Are: 1");