Managed C++ And C++/CLI :: App That Shows Pixelated Picture In Window - Reference Image On Screen?

Jan 11, 2014

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.

View 6 Replies


ADVERTISEMENT

Managed C++ And C++/CLI :: How To Create EXE File To Run It On Any Window

May 11, 2014

I have created a MFC application on Visual c++ 2012. My computer work in Win 7 - 64bits. When I see many tutorial about making the executable file which is independent on .dll library (by changing Configuration Properties ->C/C++->Code Generation->Runtime Library ->Multi Threaded Deburg (MT/d)) the compiler becomes error then I can not get the result as tutorial on internet.

Is there any other way to make the .exe file for this?

View 4 Replies View Related

C# :: Using Listbox To Change Image In Picture Box And Text In Label

Mar 21, 2012

My goal is to have couple of items in the listbox and when highlighting one item a image in the picturebox should appear, and so on for each item in the listbox.I just don't know how to change image depending on selected item in the listbox instantly.Also when i highlight item a text in label should be like in highlighted item in listbox.

View 1 Replies View Related

C++ :: SDL Window Image Flickers?

Sep 5, 2013

I've encountered a problem, whenever I debug the project, the window shown flickers with the image I'm trying to render and it doesn't respond (shows the loading cursor symbol) also the console window doesn't even open at all, Here's the code:

#include <iostream>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
using namespace std;
int main(int argc, char** argv){
cout<<"HI!!!!"<<endl;
system("pause");

[code]....

View 7 Replies View Related

C# :: Option Selection Box To Change What Appears In Main Window Screen

Sep 17, 2014

Basically i have a 'HomeWindow' with a button 'OptionWindow'. My idea is that the 'OptionWindow' button will open up the 'OptionWindow'. Which will give the user three options 'Option1', 'Option2' and 'Option3'. If they pick 'Option1' then in the 'HomeWindow' in a stackpanel i want it to display 'UserControl1'. Where as if they pick 'Option2' then in the 'HomeWindow' in a stackpanel i want it to display 'UserControl2'.

If you need some of my code that i have already then let me know what you need as i have a lot of it so can't paste it all in one go. But the new thing i need is the way of making the user-controls in the 'HomeWindow' change depending on what is selected in the 'OptionWindow'.

View 14 Replies View Related

C# :: Losing Image When Using Asp Popup Window

Jun 23, 2014

I am creating a website in which a user can upload an image to a sql database. It is converted to varbinary and then read into an Image object using a http handler to convert it to an image. this all works fine. When I open an popup window I am reading data from specific rows into textboxes, thus when the user confirms any changes the rest of the data stays the same. How can I hold the Image and redisplay it when returning to the main page after closing the pop up. It currently sets the image in the database to null as the file upload object has not been given a directory location all the time. This is my attempt at reading the image from the database and then reapplying it if the file upload is empty

private void ChangeFilm(int id)
{
SqlConnection con = new SqlConnection(my settings go here);
con.Open();

[Code].....

View 5 Replies View Related

C/C++ :: SDL Window Auto-Closes When Image Changes

Jan 22, 2014

Background: I'm making a small game using CodeBlocks and SDL. All of the code resides in a class named Game - the only thing running in Main is the creation of the Game object and the class function execute(). So far, I've made a Start Menu with three clickable buttons. I'm in the midst of making one of the buttons - Load Game - change the game screen to the Load Game menu. Basically, when the user clicks the button, the image on screen changes according to the button they click.

Issue: After successfully making the Load Game button change the image on the screen, I found that the SDL window mysteriously closes out several seconds after the image change. What is causing this - the window stays on perfectly fine until the background image is changed and the only way to break the loop is for the player to click the x on the window. I've gone over the code several times and haven't found anything that might be the cause.

Code:

Game.h file
#ifndef GAME_H
#define GAME_H
#include "SDL/SDL.h"
#include "SDL/SDL_ttf.h"
#include <iostream>
#include <cstdlib>

[Code] ....

Output:
- Window with an Start Menu image and a button with the words "Load Game".
- If user clicks the X on the window, the window closes.
- If user clicks "Load Game" button, Start Menu image changes to Load Game image. After about seven seconds, the window automatically closes out. This isn't supposed to happen.

View 5 Replies View Related

C/C++ :: Make Basic Snake Game Using Command Window And Screen Refreshes?

Apr 15, 2015

I am trying to make a basic Snake game using the command window and screen refreshes. So far I have a board, snake, food, and no walls. Basically I have it so the snake moves like the traditional snake in the game, when it eats the food once it grows. However when it eats the food a second time the game crashes. I think I have narrowed the issue down to the grow array that I have (below) but I am not sure if the issue could be a result of something else.

Grow Array

cord growArray (cord *p_values, int *size)
{
*size = *size + 1;
cord *p_new_values = new cord[ *size ];

[Code]....

View 7 Replies View Related

C++ :: SDL Fill Screen With Image?

Jul 19, 2013

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?

View 4 Replies View Related

C/C++ :: How To Change Position Of Image And Button On Window

Jan 12, 2015

The question says:

Place an Image on top of a Button. Move both when the Button is pushed.

Please have a look at this code:

#include <GUI.h>
using namespace Graph_lib;
//------------------------------------------------
class rotation : public Window {
public:
rotation(Point xy, int w, int h, const string& title):
Window(xy,w,h,title),
[Code] ....

The problem is that, it is not possible to define an Image in public/private part of the class rotation. Image needs all arguments to be supplied even when declaring one. (Image is here in Graph.h)

And if I define that Image in the body of main() function, so how to provide access for void rotate() to change its position with the position of button simultaneously.

View 6 Replies View Related

Visual C++ :: How To Detect If Window Media Player Is Running In Full Screen Mode

Jan 21, 2013

How can I check if window media player is running in full screen mode & topmost in c++ MFC?

What I used is this logic:

I compared media player full screen coordinates to that of monitor coordinates.If they are same implies media player is in fullscreen.But it has one flaw.Whenever there are control(for play,pause) displayed in full screen in media player, coordinates are not coming same as that of monitor.

View 10 Replies View Related

C++ :: How To Display Image On Output Screen

Nov 21, 2013

how to display an image on the output screen of c++ program.

I am using : Turbo c++(dos box) on win8

View 1 Replies View Related

C++ :: Capture Console Screen And Save To Image?

Jun 7, 2014

i need to capture the console screen and save to a image:)

View 3 Replies View Related

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.

View 10 Replies View Related

C++ :: Absolute Path Reference - Open File And Print Contents To Terminal Window

May 12, 2014

I am trying to open a file and print the contents of the file to the terminal window. It works when I put the file right in the directory with the Solution but not if the file is out on my desktop and I use the full path. Here is the code:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int OpenFile(){
fstream SampleFile;

[Code] .....

View 5 Replies View Related

Managed C++ And C++/CLI :: Class Of String Collections?

Nov 25, 2014

Is it legal in VC++ to create a class composed only of string colections. If it is how can I create it in VC++ and add it to my project?

View 6 Replies View Related

Managed C++ And C++/CLI :: Message Loop In Windows Forms

May 13, 2014

I'm trying to port a Win32 application over to Windows Forms so that I can have better graphical control over the interface. The program itself is pretty simple; in the main message loop it listens for a WM_CopyData containing a certain char array, and occasionally sends WM_CopyData itself after the user clicks a certain sequence of buttons.

I found a couple of pages discussing how to completely override the Windows Forms WndProc, but I rather like having the framework do all of the control and would prefer to only latch onto it, rather than replace it. So, what would be the best way to have a Win Forms application listen for Windows Messages continuously and execute a function upon receiving them?

If I do need to override WndProc, what is the syntax? I found the following code:

Code:

protected override void WndProc(ref Message m) {
base.WndProc (ref m);
if (m.Msg==0x4a) // WM_COPYDATA {
// do your stuff here...
}
}

But when I stick that into my main.cpp file right after int main function, "protected" gets highlighted as a syntax error with the message "IntelliSense: expected a declaration".

View 8 Replies View Related

Managed C++ And C++/CLI :: Designing GUI - Ambiguous Symbol String Used

Jan 10, 2014

I am working on my project of gesture recognition using c++ and open cv and i am also designing GUI simultaneously. I am using system namespace for GUI part and cv namespace for gestures.

After compiling i am getting error as Ambiguous symbol String is used.

This the link for msdn error support : [URL] .....

View 5 Replies View Related

Managed C++ And C++/CLI :: Opening Forms With Buttons From Form 1 (With Conditions)

Jun 12, 2014

I'm pretty much newbie in creating a successful GUI in C++. Although, i managed to create 4 buttons that should show a certain form. Lets say, Form1 is my main form, therefore - Button 1 will open Form2, and Button 2 will open Form3..... But the conditions is - If there is a form that is already open, clicking again on the Button that should open it, will Close it, but all the forms (form1,2,3,4,5) can be enabled together.

Also, a very important note is that whenever i close a form, in any way of closing it (Not the main form) It will "save" the changes i made (Such as ticking checkboxes and so..) and won't reopen it, it will just use "Visible" i guess ?

Notes :

If i use Form2 ^form2show = gcnew Form2;

and then Form2->Show();

I will be able to simply ATTACK the button and open Billions of form2 ^_^

Although, when i use Form2->ShowDialog();

It won't let me open the form3,4,5.

Which isn't so bad, but when i exit from the form2, it won't save my changes (Such as checkboxes..)

View 6 Replies View Related

Managed C++ And C++/CLI :: How To Use Open File Dialog With Multiple Files

Dec 21, 2014

Right now, I have and application that opens a multi file dialog box. I want to take all of the files I highlight when the dialog box shows up and display a messsage box with the path and file names. This is what I have right now:

Code:
private: System::Void button1_Click_1(System::Object^ sender, System::EventArgs^ e) {
String^ folderName;
Stream^ myStream;
OpenFileDialog^ openFileDialog1 = gcnew OpenFileDialog;
openFileDialog1->Multiselect = true;

[Code] ....

Currently, it only shows the first file that I choose. I want to make it so that the message box shows all of the files that I select when the open file dialog shows up.

View 2 Replies View Related

Managed C++ And C++/CLI :: Breaking Up Large Class Into Manageable Source Files?

Feb 9, 2015

I'm trying to make sure my code is written in smaller modules, so my first step is to create my initialization process in and external file to load the necessary data from external sources and set up things like the content of drop down list boxes.

My first attempt failed to give me access to the combobox items add function so I moved that code back into the form1.h file:

Code:
public:
Form1(void) {
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
void AddDate(char *date, int ID)
{
this->comboBox1->Items->Add("line 1");
}

It compiles fine, but the call to it in my Initialize.cpp file

Code:
MarketView::Form1::AddDate("abs",1);
Gives error C2352: 'MarketView::Form1::AddDate' : illegal call of non-static member function

OK, so I change "void AddDate" to "static void AddDate" and now get the error that "static member functions do not have 'this' pointers" so I go back to the "MarketView::Form1::comboBox1" situation where there is no legal syntax after "Box1 to get me to Items->Add

I've been an old fashion programmer for over 47 years. It seems as is the concept of programming computers has changed from the concepts of logic to memorization of complex syntax.

There has to be a simple answer to do this other than to write thousands of lines of code in one Form1.h file. I refuse to believe that the new programming concepts will not allow you to write code in smaller more manageable modules.

What is the proper syntax for breaking up the larger file into more manageable chucks?

View 12 Replies View Related

C++ :: How To Read Picture In HDC

Oct 6, 2013

#include "stdafx.h"
#include "iostream"
#include "conio.h"
#include "windows.h"
using namespace std;
void main(){
HDC hdc = GetDC(NULL);
DWORD color = GetPixel(hdc, 500, 500);

[Code] ....

From this code I think it reads pixel from screenshot. I want to read from file. I think I have to change this line

HDC hdc = GetDC(NULL);

but I don't know how to?

View 6 Replies View Related

C++ :: Array Of Char - Shows More Than It Should

Nov 9, 2013

I have this code:

#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
ifstream f("input.txt");
ofstream g("output.txt");

[Code] .....

This program make a copy of the source array, then it removes each character and shows the obtained array.

And when i insert "abcdefghijkl"

it should show this: "

#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
ifstream f("input.txt");
ofstream g("output.txt");

[Code] .....

View 1 Replies View Related

C# :: Printing Picture Not Come On Center Of Page?

Jun 11, 2014

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Bitmap myBitmap1 = new Bitmap(pictureBox1.Width,pictureBox1.Height);
pictureBox1.DrawToBitmap(myBitmap1, new Rectangle(0 , 0, pictureBox1.Width, pictureBox1.Height));
e.Graphics.DrawImage(myBitmap1, 0, 0);

[Code]...

when i print picture exist in picture box image come on top right why i need image come on center of page

View 2 Replies View Related

C++ :: How To Change Ordinary Picture With Only Red Channel

Aug 29, 2013

With using SDL_Maprgb and SDL_GetRgb. I am new to programming.

void put_pixel32 (SDL_Surface *surf, int x, int y, Uint32 pixel){
Uint32 *pixels = (Uint32 *)surf->pixels;
pixels[(y * surf->w ) + x] = pixel;
}

how do i get use of this code?

Uint32 SDL_MapRGB(SDL_PixelFormat* format, Uint8 r, Uint8 g,Uint8 b);
void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat* format, Uint8*r, Uint8 *g,Uint8 *b)

I am using the existing picture. The function is just like Photoshop, can change the color only in red channel.

View 8 Replies View Related

Visual C++ :: Zoom In Using Picture Control?

Aug 13, 2013

I'm have a bitmap that's about 4000x2000. But I want to put it all into a picture control. I attempted to use stretchBlt() to shrink it. But it did not work.

Code:

HBITMAP originalImage = CreateDIBitmap(m_picture1.GetDC()->m_hDC,
m_bmiHeader,
CBM_INIT,
(unsigned short *)m_OriginalBits,

[Code]....

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved