C++ :: How To Make An Image Popup

Mar 31, 2014

Our teacher wants us to make a timeline showing a picture from each year of our lives. I thought of a creative way of doing this in c++, make the user input the year they want to see, then make the image popup on the screen. Is this possible and how would I go about doing this? Here is the code I have so far:

#include <iostream>
using namespace std;
int main() {
int userInput;
cout << "Hello and welcome to my timeline!" << endl;
cout << "Please type in what year you would like to see and press enter" << endl;

[Code] ....

View 11 Replies


ADVERTISEMENT

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++ :: Add Custom MENUITEM To A POPUP?

Jul 13, 2014

I have a POPUP

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?

View 8 Replies View Related

C++ :: How To Manage Popup Windows

Mar 24, 2014

I’m working on a project that has many pop up windows. They are not organized properly and things are getting messy. I’m wondering if there are any common practice or design patterns for solving this problem.

I’d like to give some concrete examples:

1. my program connects to two different tcp ports on the same ip. cutting off any of them, the user will be notified with a MessageBox. But in case of unplugging network cable, both message box will show, which is unnecessary.

2. we provide a shortcut key to display a setting dialog. However the program can also show the same dialog when certain event happens. If the user opens the setting dialog already, those event will still trigger a second setting dialog.

3. when application settings are not correct, user will disconnect from the server and an error dialog will show up and terminate the program. But if the user knows about the situation and has opened the setting dialog to fix the issue, the error dialog will terminate his work. which is bad.

I don’t know how to deal with this window management problem in a complex software project. Of course, I can solve the issue case by case by checking if certain dialog is shown before displaying another dialog. But there are too many cases, when the code base gets big, this is not practical. There must be some generic solution I think.

View 4 Replies View Related

C# :: Save Selected Text From A Popup

Apr 17, 2014

I want to select text entered in a popup and save it. I have a form that contains a text area and a button

<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="103px" Width="262px"></asp:TextBox>
<br />
<br />
<asp:button runat="server" text="Add" onclick="Unnamed1_Click" />

when we click on a line in text area I want to open a popup having all text from that line. I should be able to select some of its text then if I click on save button of popup then only selected text should be saved and displayed in original text area of form. I want to use this for multiple sentences of text area.

Add button will add new line.

View 8 Replies View Related

Visual C++ :: Member Function - Add Vertical Colour Text In Popup Menu

Jun 4, 2013

I was reading a c++ code written in embarcadero ide to add vertical colour text in popup menu.

While reading the code, I had seen following instructions.

private:

Code:
void __fastcall ExpandMenuItemWidth(TObject *Sender, TCanvas *ACanvas,int &Width, int &Height);

Code:
void __fastcall DrawNewItem(TObject *Sender, TCanvas *ACanvas, const TRect &ARect, bool Selected);

The above two methods used in the code like below:

Code:
PopupMenu1->Items->Items[i]->OnMeasureItem = ExpandMenuItemWidth;
PopupMenu1->Items->Items[i]->OnDrawItem = DrawNewItem;

What is happening when we are using member function without parameters like above?

I found above code at: [URL] ....

View 2 Replies View Related

C# :: Compare The Image Of A Button To Another Image In Visual Studio

Jul 3, 2014

Im trying to compare the image of a button to another image in Visual Studio like so...

//variables
Image active = Image.FromFile("C:\Users\Ethan\Desktop\StarWars Status\active.png");
Image stunned = Image.FromFile("C:\Users\Ethan\Desktop\StarWars Status\stunned.png");

[Code]...

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)

View 1 Replies View Related

C++ :: Add Padding In BMP Image

Feb 1, 2015

I am working on pset4 in the CS50 online coarse. The goal is to resize a bmp image. I have it working except adding the padding back to new resized image. The image I am using uses 3 bites of padding. If the factor I resize the image by works out to have 3 bites of padding it works perfect and if the image has no padding it works perfectly I need a fresh pair of eyes. I am not sure how to add the images so here is the address to download the images and the skelton of the source code they gave to modify. [URL] .... The image that requires the padding is labled as small.bmp.

#include <stdio.h>
#include <stdlib.h>
#include "bmp.h"
int main(int argc, char* argv[]) {
// ensure proper usage
if (argc != 4)

[Code] .....

View 2 Replies View Related

C++ :: Run Image (GIF File) Through CMD

Apr 6, 2014

I would like to know if it possible to "run" an image through CMD.In other words i want that image to be opened on CMD.

BTW the image which i am more intrested is GIF files.

View 3 Replies View Related

C++ :: Image Not Showing On Top

Jul 1, 2013

I am trying to display images on top of my Background image gui, so like buttons an stuff but the problem is that there not showing ontop. I can only get one of them to show

// includes
#include <windows.h>
#include <stdio.h>
#include "res.h"

// defines
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002

[Code] ....

View 1 Replies View Related

C++ :: Displaying Image From Stream

Feb 24, 2013

I'm trying to display an image from a stream data. But there is no image when getting image::from stream.

It's my source code:

Code:
IStream* pstream = NULL;
if(SUCCEEDED(CreateStreamOnHGlobal(NULL, TRUE, &pstream))) {
ULONG lreal = 0;
pstream->Write(chIncomingDataBuffer, iEnd, &lreal );

[Code]...

There is no image from data.

View 5 Replies View Related

C :: Image Rotation Without Cropping

Nov 4, 2014

I am new to image processing..... and I am learning the concepts.

Recently I have done image rotation of grey scale image using the following formula:

x' = xcos(theta)-ysin(theta)
y' = xsin(theta)+ycos(theta)

The problem i have faced is image is getting cropped.

I want to rotate an image without cropping. I have searched a lot but I am not getting any algorithm based on C. How to get the algorithm for image rotation without cropping.

View 2 Replies View Related

C :: Editing Image In PPM Format

Mar 10, 2014

I'm trying to edit an image by multiplying the red component of each pixel by 10 and leaving the other components (green and blue) untouched. I'm not really sure how I'm supposed to edit the pixels one by one. I have this so far. I think there is something wrong with my ppm header as well. Is there a way to make a ppm header without specifying the bounds so that it conforms to the image you are putting in?

Code:

#include <stdlib.h>
#include <stdio.h>
#define PICTURE_FILE 1
#define MIN_ARGS 2
#define h 768
#define w 1024
void solve(FILE *in_picture, FILE *out_picture)

[Code] .....

View 6 Replies View Related

C :: Read A 24 Bit Image Using 2D Array

Oct 29, 2013

I am trying to read a 24 bit image but I'm getting errors when I'm tryting to read the pixels.

-The reading part looks bad because I'm reading both headers field by field. But I'm sure that it is reading both headers correctly.

-Right now my biggest concern is to get it to read successfully an entire bmp image

I'm using this calculation to get my padding bytes:

padding bytes = [4-(3*width)mod 4]mod 4

When I use a 2x2.bmp file to test it, I get an error that the [1][1] pixel was not read. When I use a bigger image it gives me the same error after about 100 rows and then every pixel is an error from that point on. This is what I got so far:

Code:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
const size_t cSizeofPixel = 3; //size of struct tPixel
typedef struct{
unsigned char blue;
unsigned char green;
unsigned char red;

[Code]...

I read this post Reading 24 bit BMP file into a 2d array.

I still don't know if my error is when I allocate memory to my 2d array, or if I'm doing the padding bytes wrong or if it is something else.

View 8 Replies View Related

C :: Printing A Circle In PPM Image

Oct 30, 2013

I'm supposed to print a small rectangle inside concentric circles that are inscribed in a rectangle.I'm not really sure where to start with printing a circle in a ppm file.

View 13 Replies View Related

C :: How To Display Image With Text

Mar 27, 2013

I'm pretty new to C, just looking to see how to display a image and some text to go along with it so far I can display in the image but cannot display the text at the same time.

This is my source code below

Code:

#include <stdio.h>
#include <gd.h>
int main() {
gdImagePtr gdImage = gdImageCreate( 100, 100 );

[Code]...

View 2 Replies View Related

C :: Mirroring Image Over Y Axis

Nov 30, 2014

how to do the mirror function? I have my other two working 100% but for some reason i cannot figure out how to do the mirror part. I want it to be like my flip function(lower code) where I can print the image through the for statement

Code:

int main (int argc, char *argv[]) {
// declarations here
// open input file
FILE *input;

[Code].....

View 1 Replies View Related

C :: Reading PPM Image Into 1D Or 2D Array

Apr 4, 2013

I have an assignment where I need to take an assigned image, rotate it 90 degrees to the right, flip it upside down, and turn it to grayscale; each with different outputs.

I was thinking if I can read in the image into a 2d array //array[height][width] or even just an array with the values of each pixel (r, g, b), I can just modify the array and spit it out when done.

if i can just get it into the array, I think I'll be fine. We've done similar assignments with modifying arrays for grayscale images and the other two I can probably figure out. But how am I going to read in each pixel into an array with three different values in each slot? This is my code so far:

Code:
#include<stdio.h>

View 1 Replies View Related

C :: Resize A Bitmap Image

Aug 22, 2014

I am trying to re-size a bitmap image for a class.They gave us two options to use to do the program with: an array or move the file position indicator. I want to use the file option. All the bitmap header info is checking out. The file after being re-sized should be 822 bytes but it is 1.6 KiB and the image is distorted.

Code:

#include <stdint.h>
/**
* Common Data Types
*
* The data types in this section are essentially aliases for C/C++
* primitive data types.

[Code]...

View 2 Replies View Related

C++ :: OpenGL - Draw On Top Of Image

Jun 22, 2014

This is my first time using opengl and I am experimenting with adding/drawing polygons/points/etc. on top of a PPM image. The image is already loaded when the application runs. My attempt to draw a square is from lines 30 - 35. The program runs but the square is not present. Just the image.

#include<windows.h>
#include <stdio.h>
#include <stdlib.h>
#include<Gl/gl.h>
#include<GL/glut.h>

int n;
int m;
int *image;

[Code] ....

View 5 Replies View Related

C++ :: Convert Image To Number

May 15, 2013

I want to convert image to number.

View 12 Replies View Related

C++ :: Use 3D Array To Create Image

Sep 16, 2014

My assignment is use a 3D array to create an image. Use an array of the form arr[300][200][3]. For this homework, you need to use an array of the form arr[3][400][500]. It will have 400 rows and 500 columns. You need to first initialize the array as described in class and after that write the array to a ppm image file. When viewed using Gimp, it should display USM. The letters would be 200 pixels high and 100 pixels wide each. Use at least 15 pixels for the width of the stroke. Use different colors for each letter and a different color for the background.This is what I have so far.

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

void initialize(unsigned char a[][200][3], int nrows, int ncols, int nc);
void printAll(unsigned char a[][200][3], int nrows, int ncols, int nc);

[code]....

View 3 Replies View Related

C++ :: Embed Image With Graphic?

Apr 16, 2014

How can some one embed image in C++ with graphic?

View 2 Replies View Related

C++ :: Stretching Image By Dimensions

Dec 16, 2013

Write a function that takes a picture and two integer values ​​and stretching the image by dimensions.

View 8 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++ :: Load PNG Image To Use As Texture?

May 24, 2014

I'm trying to load a PNG image to use as texture, but when I compile the sdl window closes. I'm sure the error is in the function of generating the png texture, because when i don´t use this function, the sdl window does not close. So debugging using cout i found that the cout above glTexImage2D function, shows in console, but the cout in below of glTexImage2D does not work. Does not reading this image?

hear is the function

#include "Texture.h"
#include <iostream>
Texture::Texture() {}

[Code].....

View 9 Replies View Related







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