C# :: Draw Multiple Rectangles With Mouse In Picturebox

Jun 6, 2014

I am trying to build a WinForm application that will allow you to load an image into a picturebox and then draw multiple rectangles (empty or translucent) to kind of highlight areas. I want all the rectangles to stay on the image (i can take care of a clear method later). The code below has the latest two attempts I've tried. One is all commented out and the other is not. Both will load the image just fine but neither will allow me to draw/select rectangles on the image.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;

[Code] ....

View 14 Replies


ADVERTISEMENT

C# :: Make A Picturebox Move Inside Another Picturebox From Left To Right

Mar 3, 2014

I'm currently reading/programming from "Head first C#" book. I have this project which is making a program that has four dogs which race and there are three players that can bet on the race. I need to learn how to make the "dogs" (picture boxes) move from left end to the right end of a picture box.

Here is the code:

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

[Code].....

View 2 Replies View Related

C++ :: Draw The Same Sprite Multiple Times (SDL)?

Sep 7, 2014

I have a question about SDL and drawing sprites (SDL surfaces). My idea is that the user can create a wall of separate sprites by create one sprite each time in the current mouseX and mouseY position, when the user push down the e-key. The problem is that I have no idea how I could draw the same sprite multiple times without to delete the previous one.

View 3 Replies View Related

Visual C++ :: Draw Multiple Lines And Move Them On Screen

Jul 28, 2013

I am writing a pure C based win32 applications. I have drawn line. Now i want to translate that line, move the line whereved user wants to move on screen. Then again I drawn another line, I am drawing multiple lines.

I have created rectangle region for each line and trying to move the line.

When I move the 2nd line over the 1st line on screen the 1st line is getting wiped out. Because I am InvalidateRect() of the rect for the line being moved, so when that rectangle is crossing the other line then the other line is getting removed from the screen.

How can I rectify it. How can I have all the lined being on the screen and moved according to the user's wish. The code should be pure C and win32 no MFC.

View 4 Replies View Related

C++ :: Calculate Integral Using Rectangles

Feb 13, 2013

I have a function written to calculate an integral using rectangles. I get this error: 'cannot convert double to double (*) (double) in assignment'. But whenever I remove one of the doubles something is undeclared.

double rect_integral(double a, double b, int n, int f) {

double x;
double (* fx) (double);

double func_1 = 5*(pow(x,4))+3*(pow(x,2))-10*(x)+2;
double func_2 = pow(x,2)-10;

[Code] .....

View 3 Replies View Related

C# :: Could Not Find File PictureBox

Mar 24, 2015

I am working with windows mobile 6.5 and sql compact, trying to create application to save pic on database but when i try to save pic that loaded to picturebox it giving this error "could not find file 'picturebox" and in windows mobile we don't have imagelocation property and this is code that i use it

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;

[code]....

View 3 Replies View Related

C# :: Picturebox Size In Parent Container

Aug 22, 2014

I have a picture box, inside a table layout panel. The default size for the picture box is 456, 457. However, what I want to do is have the picture box be the size of the available area, even if the form is full screen.

I have the picture box dock set to fill etc. but not matter what I do, it refuses to change the dimensions from the ones above.

The only work around I could find that worked was this:

this.pbMainMap.Size = new Size(Screen.GetWorkingArea(this).Width, Screen.GetWorkingArea(this).Height);

Which is pretty useless if you are using a table layout panel. Can I grab the dimensions from the cell I am in or something?

View 4 Replies View Related

C# :: PictureBox To Memory Stream In Socket?

Mar 7, 2014

I Was Try To Change PictureBox To The Memory Stream And Then I Read Memory Stream Bytes And I Send Over The Netwrok Here Is Code

MemoryStream ms = new MemoryStream();
pictureBox1.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); // we save the image in side the Memory strem
byte[] pic_array = new byte[ms.Length];
ms.Position = 0;
ms.Read(pic_array, 0, pic_array.Length); //

[Code]...

but when i want get the Data o mean Bytes from Network tream How can i save in memory stream then dispaly in the picture box ? i try some thing but it is gave me error !

Socket handlerSocket = (Socket)alSockets[alSockets.Count - 1];
NetworkStream networkStream = new
NetworkStream(handlerSocket);
int thisRead = 0;
int blockSize = 1024;

[Code]...

View 2 Replies View Related

C# :: Using Combobox To Change Image In Picturebox?

Jun 13, 2014

I've been working on making a sprite generator and this is one thing that has kept giving me difficulties. No matter what I've looked up nothing directly says how to nor can I find anything on a similar topic to try and apply to it either. I know how to add the resources and names for the options but how do I get the options to make my picturebox image change in relation to the selection?

View 4 Replies View Related

C Sharp :: Viewing A DICOM In A PictureBox?

Feb 5, 2014

I've been looking for a C# library that is well documented and can show DICOM (medical CT scan data, including the image) as jpeg/bmp data that is viewable in a PictureBox.

I've only found OpenDicom which is more or less unsupported now and EvilDicom - whose owner has made some significant changes to it, making all existing stack overflow questions on it irrelevant.

View 1 Replies View Related

C# :: Retrieve Image From Database And Display In Picturebox

Sep 18, 2014

I am creating an employee details project, the image is getting stored in the database but i am not able display it in the picture box.

private void button1_Click(object sender, EventArgs e) {
SqlConnection con = new SqlConnection(Connectionstring);
con.Open();
SqlCommand cmd = new SqlCommand("select photo from emprecordtable where eid='"+comboBox1.Text+"'", con);
//SqlDataAdapter da = new SqlDataAdapter(cmd);
//DataSet ds = new DataSet();

[code] ....

In sql server i have table called emprecordtable and i have the fields eid, rfid, empname, designation, phno, addres, and photo which is the image field and i have given the datatype as image but in the database the image is getting stored as Binary Data.. So, how to display in the picturebox from the database.

View 11 Replies View Related

C Sharp :: Saving Picturebox Image With Graphics In It

Aug 23, 2013

What i'm trying to do is load an image from my database create some graphics to it. probably just some lines and marks and save it back to my database. here's so far what I got.
 
for creating graphics:  
 } private void pictureBox3_MouseDown(object sender, MouseEventArgs e) {
            draw = true;
        } private void pictureBox3_MouseMove(object sender, MouseEventArgs e)  {
            if (draw)  {
                Graphics g = Graphics.FromImage(pictureBox3.Image);
 
[Code] ....

but the saving part doesnt work :( I think it only saves the image loaded to the picturebox but not the graphics created to it. how to merge it? i've tried to google it and found some sort of same cases but fails to make it work, something like converting it to bitmap.

View 2 Replies View Related

C Sharp :: Motion Of Controls - Picturebox Position In Form?

Apr 8, 2012

I have a form with a picturebox and some buttons to move the picturebox. I don't want the user to guide the picturebox out of the form even by dragging the form border picturebox moves just in the form border, and also there is a button to guide the picturebox to the start position (start choose by user). What can i do?

View 1 Replies View Related

C++ :: How To Draw A Polygon

Nov 16, 2013

I am fairly new to c++, and I want to be able to draw a polygon. When I have searched for how to draw one, the only thing i can find is scripts doing things like this:

*
**
***
****
*****

I doubt that c++ is that primitive, and I'm looking for something like the c++ equivalent of this python script:

Syntax: draw.polygon((20,20)(30,30)(50,30)(20,40)(20,20), fill(green))

I am using a mac os 10.9

View 2 Replies View Related

C :: Draw A Grid Using The Characters?

Aug 20, 2013

I'm trying to create a grid using the following characters: !, @, #, $, &.

It's an 8 x 8 grid, and should contain the characters in no particular order (trying to create a Bejeweled-like game).

I already defined the width and length to be 8, so:

#define WIDTH 8
#define LENGTH 8

Code:

void makegrid(char grid[])
{
int j;
int k;
for ( j = -1; j < LENGTH; j++ )
{
for ( k = -1; k < WIDTH; k++ )
{
/* I don't know what to type here anymore :( */
}
} }

View 14 Replies View Related

C :: Calculator Using Mouse With A Bug While Dragging

Mar 6, 2015

I have an assignment to do a calculator in C, wich will work by clicking the numbers with the mouse, however i have a bug that when i hold the mouse and dragg it, it assumes that I'm clicking multiple times, also, when I click in an empty space the program creates a blank space on the calculator screen.

Code:

#include <stdio.h>
#include <conio.h>
#include <math.h>
#include "..MouseHandler.h" // ajustar o caminho ao seu projecto
#include "..calcSkinLib.h" // ajustar o caminho ao seu projecto
#define PI = 3.1415;

[code]....

View 2 Replies View Related

C :: Detect Mouse Movement

Aug 17, 2013

i was trying to write a program in c language which can detect mouse movement, but the program which i have written can only detect the mouse click or scroll the program which i have written given below..

Code:

#include<stdio.h>
#include<string.h>
#include <ncurses.h>
int main() {
}

[code]....

run the programme with linked-lncurses. improve my program which also detect when the mouse moves.

View 1 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++ :: How To Use Mouse In Win32 Console

Jan 28, 2014

I want to show and control mouse in Win32 Console. What should I do? And I want to learn MFC programing.

View 3 Replies View Related

C++ :: How To Draw A 3D Snake In OpenGL

Jan 3, 2014

i want to draw a 3D snake in opengl.. i can't get nothing out of my search to make a start.. how it is made

View 4 Replies View Related

C++ :: How To Draw Lines With Different Colors

Nov 8, 2014

I want to write a function called DrawLineSegments.This function must change the color of lines at every corner where the corner angle is greater than 60 deg (Assume that there is a function called checkangle). The color sequence must be black, red, green, blue, and repeat this sequence after the fourth color.

View 1 Replies View Related

C++ :: Draw 2D Bar Chart According To 10 Or 15 Numbers?

Nov 26, 2013

I want to draw a 2D bar chart according to 10 or 15 numbers in c++. How can i do it? Which i need components?

View 1 Replies View Related

C++ :: How To Use Mouse In Drawing Shapes

May 3, 2013

i have to make an application called " paint " in c++ . It should facilitate user to draw different shapes using a mouse. Now the biggest hurdle i am facing is the usage of mouse .. what is the header file for usage of mouse ? i am using visual studio 2010 . the syntax is creating problems ..

View 1 Replies View Related

C++ :: How To Draw A Magnifying Glass

Jul 11, 2013

I want to draw a magnifying glass using graphics.h which is used mostly as "Search" icon. But, I am having problems in making the rectangle attached to the two circles (one inscribed on another) . I have also included the screenshot (made in powerpoint) on how the output will look like, enen I've made most of the part, except the search icon (magnifying glass).

The Link for the screenshot is : [URL] ....

View 3 Replies View Related

C/C++ :: How To Draw Shapes Using Loop

Apr 11, 2014

How can I draw thus shape using loop for
0
0 1
0 1 2
0 1 2 3
0 1 2 3 4
0 1 2 3 4 5

Also this shape
1*****
12****
123***
1234**
12345*
123456

View 6 Replies View Related

C# :: How To Draw More Than One Line In WPF Using Array

Jul 8, 2014

I used the following code. I called a method named lets_draw

private void lets_draw() {
int i,z;
z = 40;
Line[] line = new Line[20];
for(i=1;i<=10;i++) {

[Code] ....

But it showed the following message

"An unhandled exception of type 'System.NullReferenceException' occurred in SkeletalTracking.exe
Additional information: Object reference not set to an instance of an object."

View 1 Replies View Related







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