473,466 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# draw on a image

3 New Member
Dear experts,
Iwant t,o
1.open an existing image (in the form i need browse button from with i should be able to locate the file)
2.Draw some rectangles on it.
3.save new image as a jpeg also by browsing and locating the plase

plz give me steps and codes.
Mar 23 '09 #1
7 9988
Plater
7,872 Recognized Expert Expert
Look at the Bitmap and Graphics objects, they contain the bulk of your work. The OpenFileDialog and SaveFileDialog will help you with file selecting.
Please research and do your own work
Mar 23 '09 #2
raala
3 New Member
Actually I’m new to C#.NET really appreciate if you could tell me what ihave to do step wise and please give me the cording.
Mar 24 '09 #3
IanWright
179 New Member
@raala
Well it doesn't really work like that on here. People like to see you do your own work...

Browsing : Look at the OpenFileDialog class as mentioned, this will allow you to browse to your file.

Drawing rectangles... take a look at Graphics.FromImage() and then Graphics.DrawRectangle().

Saving... Look at Bitmap.Save()

That's a little bit more information than you've been given. If you're not sure where to look try typing "MSDN OpenFileDialog". It's got everything on there, and often with good examples.
Mar 24 '09 #4
raala
3 New Member
thanx for your reply. But I can't understand what is ment my"people like to see you do your own work.."
Mar 24 '09 #5
Bassem
344 Contributor
Hi raala,
Don't wast your time posting "thanks" and "what did you mean?" instead check class Bitmap as Plater an IanWright said.
With Bitmap you can get to the data of the image (pixels) modify as you wish.
Use OpenFileDialog control and SaveFileDialog, so easy to use.

When you've any problem, post your code and we'll be glad to help you.

Regards,
Bassem
Mar 24 '09 #6
Plater
7,872 Recognized Expert Expert
@raala
It means we're not here to do your work for you. We have given you more than enough to accomplish your task. Its up to you to look up how to use those classes and implement it.
Mar 24 '09 #7
Frinavale
9,735 Recognized Expert Moderator Expert
@raala
Hi Raala,


All the information you need on the Graphics class, Bitmap class, and any other .NET classes or controls can be found in the MSDN Library. This resource should get you pointed in the right direction. I recommend bookmarking the MSDN Library and using it as your primary resource when developing in .NET.

You're also going to be interested in using the OpenFileDialog. This lets the user browse for a file and will give you a path to the file they selected.

Once you have a path to the file you need to open it. There are a number of classes available to you in .NET that will let you open files. These are found in the System.IO namespace. The File class in the System.IO namespace has a bunch of methods that let you do things like open, copy, move files.

First try loading an image and saving it.
Then try moving on from there.

-Frinny
Mar 25 '09 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do...
6
by: felix | last post by:
Hi, I have an Image that is drawn with Graphics.DrawImage(..). What I want to do is drawing it with a given transparency, e.g. at an alpha of only 180 instead of 255. How am I doing that?!?!?...
3
by: Jheitmuller | last post by:
Hi, I would like to convert a VB.NET application from being a Windows app to an ASP.NET app. I'm new to web development, so this may be a simple question. Is it possible to render simple drawing...
10
by: mrajanikrishna | last post by:
Hello friends, I have developed an application using ASP.NET and SQL Server. Ours is a garment factory. I need to design another module in my application. I want to generate images on fly...
1
by: zxo102 | last post by:
Hi everyone, I have tried two days to figure out how to draw the image in wx.BufferedDC on the page created by AddPage of wx.Notebook but still got no clue. The attached example works fine. If...
3
by: Daniel Mark | last post by:
Hello all: I am looking the sample code posted on PIL website http://www.pythonware.com/library/pil/handbook/imagedraw.htm ################################################ <<Draw a Grey Cross...
0
by: benfly08 | last post by:
Hi, guys. I have a program to draw bar/pie chart based on the data i hard coded in it. However, my image comes with "BLACK" background color. I don't know how to fix this. The code snippet is...
0
by: dazzler | last post by:
I'm trying to draw line to an existing image, the problem is that the image doesn't update/refresh itself. In the example there's one button, but when pressing the button it changes the image but...
1
by: kummu4help | last post by:
hi, i want to draw rectangle based on mousedrag event. if user dragging the mouse, then the rectangle on the applet should increase or decrease basing on current mouse coordinates. i have the...
1
by: martinsmith160 | last post by:
Hi all I am trying to create a level builder tool for a final year project and im having some problems drawing. I have placed a picture box within a panel so i can scroll around the image which is...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.