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.
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 need to apply theme file in windows form but I can't. When I use the code below I get error because there is no System.Windows.Application
StreamResourceInfo sri = System.Windows.Application.GetResourceStream( new Uri("App.xaml", UriKind.Relative)); var resources = (System.Windows.ResourceDictionary)Load(sri.Stream); ; var app = new System.Windows.Application(); app.Resources.MergedDictionaries.Add(resources);
btnStatusPlr1.Image SHOULD come back as True.Then I realized it might not be the same as setting the buttons image in the properties (Which is what i did to get the original image (the one being compared to))
I do have a feeling ive done something wrong here (Yes im a noob /> )
Variable active, is the same image as the buttons default (Well should be)
I've written a doubly linked list per my assignment instructions. I've implemented begin() and end() iterators for it, and they work with no problems when traversing the list. However, I need to sort the elements in the list. We are allowed to use the sort function defined in the <algorithm> header since we haven't yet covered sorting algorithms.
But, I'm running into a ton of problems. I figured as long as the begin() and end() iterators were defined for the list, then sort(list.begin(), list.end(), compare) would do the trick. The main errors I'm getting are:
error: no type named iterator_category error: no type named value_type error: no type named difference_type error: no type named pointer error: no type named reference
And also errors for no match of the + and - operators for the iterator class.
I understand reference, pointer, and value_type, but I have no idea about iterator_category and difference_type. Additionally, I'm a little unsure why the + and - operators need to be overloaded.
MAIN_MENU MENU { POPUP "&Manager" { MENUITEM "New Royal Python", MENU_NEW_ROYAL_PYTHON POPUP "&Select Python" { } } }
I basically want to give the POPUP an ID so I can talk with it but it does not seem to be accepting a second parameter. Once I have done that I need to send a message to it to ask it to add a new item, what are the messages I need to send for this?
I am making a level editor that needs to output a custom map file for use with source code that I will write for a graphics library.
My question is: What do I need to bear in mind when deciding how to structure a custom file type? Also how can I encode a standard bitmap image into my file (the tile set) so that it can all be contained in a single file rather two files; the map file and tile set (.bmp file).
I have begun switching from WinForms to WPF and I'm having a hard time understanding the new concepts. In WinForms, I had a few User Controls, custom drawn using shapes (rectangles, ellipses, etc). They had some unique properties, like "Flashing" (setting this property to True and setting the "Flash Interval" property to 500 would have resulted in the control changing its background color to white and back again, every 0.5 seconds), "Beeping", etc.
I have tried to replicate these controls in WPF/XAML and so far managed to draw the shape. However, when it came to implementing a custom property that would redraw the background color of the rectangle every interval set by user in another property, i got stuck. The property is being set, but it doesn't change the background color. Alternatively, i have tried this method, with the same results (i got it to show in the "Properties" window in Visual Studio, i can set it, it is being stored in XAML, but it doesn't affect the background.
C# code behind: public struct LCARSColors { public static Brush DarkBlue = (Brush)(new BrushConverter().ConvertFrom("#FF3366CC")); public static Brush LightBlue = (Brush)(new BrushConverter().ConvertFrom("#FF99CCFF")); public static Brush Pink = (Brush)(new BrushConverter().ConvertFrom("#FFCC99CC"));
[Code] ....
If i use this line (commented in this code sample):
I've done some research and found that people use Mah metro, though I don't want to use that because I want to make a GUI that is fully mine, so I can do what ever I want to customize it to my liking.
I was going through tutorial in WPF on customs Cursor, While Running the application i am getting an exception XamlParseException was unhandled, here the code
public partial class MainWindow : Window { public MainWindow() {
I have been trying to make a custom control(list box with more features). I know how to setup custom properties, but how do I make it so that the property can be edited in a separate window ?
I think I figured out how to show the form itself, and I don't know how to make the [...] button like :
There's not much Custom Control tutorials out there, and that's really the problem here.
I've been pondering which of these 2 approaches would make for the best interface for a library: Defining custom exceptions with specific names for different error scenarios but with standard behaviour, or simply using the predefined exceptions from the STL.
This is my current approach: Code: namespace rpp { class ConnectionError : public std::exception { public: ConnectionError(const std::string &p_err);
[Code] .....
This seems to make for more descriptive code but it adds no functionality and the implementations are completely identical, which seems "off" to me, somehow.
When I ran it only the calls from doers array is called 7 times normally, and donters only one time. Why is that? When I call doers from the second loop, it prints the doers functions again....and only one call to donters is made to the first static inline donter functions __dont1()...
I'm working on a code for ascertaining the minimum penalty of an assignment problem. The basic complication of my code is this: I have a vector of objects of a custom struct. The struct has a member, which is an integer. I need to keep the vector sorted according to that member, even when objects are added to or deleted from the vector. To illustrate the problem, I'll give an example.
Code:
typedef struct examplestruct{int i; char c; ...} es; int function(void) {vector<es> ObjectTable; //insert an object so that the vector remains sorted according to i insertobject( newobject, &ObjectTable); //deleting the top element of the vector deleteobject(&ObjectTable); return 0;}
I have tried to do it using bubblesort. But it's too slow. How to make a heap out of it.
The detailed premises of the problem is this: There are a number of jobs, and with each job a completion time and a cost coefficient. We are to ascertain the optimal sequence of jobs for which the penalty is minimum. Now, suppose we are given jobs A, B, C, D and E. We find out the lower bound of penalties for all the jobs.
Suppose we find B has the lowest penalty. Then we find out the lower bound of penalties for BA, BC, BD and BE. We continue this until we have the best value and a complete sequence. The way I have implemented this in a code: I have created two structs. One is Job, with the completion time and cost coefficient as members. The other is Node. Nodes have a Job Array and a Penalty as members. Now, we have a vector of Nodes which we need to keep sorted according to the penalty. We need to insert new Nodes and delete the expanded Nodes.
I have included my code. The pushInTable function inserts the new Nodes in a sorted vector. But it slows down remarkably when we give more than 20 jobs as input.
I'm trying to make a windows-focused , I will make it portable after , audio function that plays sounds according to my midi file. I know there is playsound, but it's not what I desire. I'm curious if Beep plays through the sound card or is similar to printf("a") ? I'm just looking for a low level solution.
I am currently working on a custom "Array" class for a project, and I have run into an error I don't quite understand the source of. The relevant code is as follows:
template<typename T> class Array { private: T errValCopy; public: T __errVal__; uint16 __size__; T* __ptr__; Array(const T& errorValue);
[Code] ....
When I try to run the following code:
Array<Array<int>> a(Array<int>(-1));
The error log tells me there is no appropriate default constructor available. If I understand it correctly, "default constructor" refers to the constructor which lets you just write Array<int> a; instead of Array<int> a(...);, but I can't see where in the code such a situation occurs...
I've been working on a project for a few days now, and within this project I need to have a class system that can function similarly to an if statement. The problem I'm having is I can't seem to find any good information on the order in which if statements process the information within it. I understand that if statements process whatever's in parenthesis first, but my question is that when their are several booleans of equal value, for example: "if(x == 1 && y == 2 || 3 == 4 && 4==6)", in what order does it process these true or false statements? (The actual content of the example is superfluous).
Development of a custom binary file type? So far all I know is the just the basic structures of the binary file type, I know that structures are involved but the implementation part I have run into walls.
I have made a custom class matrices class which allows me to add, multiply, subtract (etc.) matrices. I have the following method for multiplication but I get an error that says
'invalid use of 'this' outside of a non-static member function'
How can I refer to the current instance without getting this error.
I am trying to create a custom ValidationAttribute in my c# .net code. I have done a lot of searching and have code that should be working but the IsValid method is not firing as far as I can tell.
Model code:
[Required(AllowEmptyStrings = false, ErrorMessage = "required")] //[Range(2014, 2100, ErrorMessage="Please enter a valid year.")] //[RegularExpression(@"^d{4}$", ErrorMessage = "Please enter a valid year.")] [ValidYear(ErrorMessage="Please enter one >= 2014")] [Display(Name = "Exp. Year")] public string expYear { get; set; }
And this is the class in that same model:
public class ValidYearAttribute : ValidationAttribute { protected override ValidationResult IsValid(object value, ValidationContext validationContext){ return new ValidationResult("Something went wrong"); } }
I'm working on writing some classes around a ROM hardware addon card. The classes expose the data on the ROM as a container with iterators, much like a vector or a list.
The classes don't have any data themselves, since all the data is on the ROM.
I'm having some dillemma's as to how to approach/implement the classes. If you were to write somethign like this... Or were using something like this written by someone else.... How would you expect this to be done ?
1) Make all the member functions static, make a private constructor to prevent making instances. This works, but may look a bit weird...
Code: for (auto it = RomTable::begin(); it != RomTable::end(); ++it)
2) expect users to make a (dummy) instance, then use it as a regular container. this might be a bit counter intuitive since the class has no datamembers.
3) create a single instance, expect users to use that everywhere. make the constructor inaccessible. Some C++ 'purists' might perceive this as global data and thus not a good solution ?
Additionally. Do I need to provide both a const_iterator and an iterator ? There's nothing to be modified, so I'm guessing an iterator isn't needed (?) Or will some STL stuff not work without an iterator ? I'm obviously not fussed about the STL functions that make changes to the container to not work (like sort, fill, swap...)