473,570 Members | 2,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clipping a pic and saving it in a file in DOT NET

Hai

Im a newbie

I have a picture in a picture box

I drag a portion of the picture with the mouse.....

Here i get the area i dragged in and now i want that area to be a
separate picture saved in my hard disk

how do i do that?

i got two (x,y) co-ordinates where i started to drag and where i
finished dragging...

i got the width and height of the portion of the picture

how do i get the actual portion of the picture saved as a separate
file???

can anyone give me the code for that?

thanks in advance

Jan 30 '06 #1
4 1273
Dnia 30-01-2006 o 13:09:18 Dixon <vi********@gma il.com> napisa³:
Hai

Im a newbie

I have a picture in a picture box

I drag a portion of the picture with the mouse.....

Here i get the area i dragged in and now i want that area to be a
separate picture saved in my hard disk

how do i do that?

i got two (x,y) co-ordinates where i started to drag and where i
finished dragging...

i got the width and height of the portion of the picture

how do i get the actual portion of the picture saved as a separate
file???

can anyone give me the code for that?

[PD]
1. Create second Image (Bitmap) with the size of (X2-X1), (Y2-Y1)
2. Create Graphics for it (Graphics.FromI mage)
3. Draw correct portion of the source graphic to the destination graphic
(one of the Graphics.DrawIm age methods allows you to do that)
4. Save the destination image (Image.Save)

--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com
Jan 30 '06 #2
It doesnt work out

how do i set the size of the picture object its read only

my picture object is a bitmap object

?????

Jan 30 '06 #3

"Dixon" <vi********@gma il.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .

Please do not crosspost questions to both .NET and non-.NET groups. The
*.vb.* groups are for VB6 and earlier. All .NET groups have "dotnet" in
their names.
Jan 30 '06 #4
Dnia 30-01-2006 o 15:10:56 Dixon <vi********@gma il.com> napisa³:
It doesnt work out

how do i set the size of the picture object its read only

my picture object is a bitmap object

[PD] Bitmap destBitmap = new Bitmap(width,he ight);
--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com
Jan 30 '06 #5

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

Similar topics

1
1818
by: John Hunter | last post by:
Does gd lib or gdmodule support clipping? I would like to set a clip rectangle and when I issue drawing commands (like im.polygon) have only the part of the polygon inside the clip rectangle displayed. Thanks, John Hunter gd-2.0.15 gdmodule-0.42
14
2059
by: Doug van Vianen | last post by:
Hi, I am trying to show a clipped part of a picture on a webpage and move it on the page and/or change the clipping to a different part of the picture. I show the picture in the body of the page by using <div id=div1 style="position:absolute; top:200; left:400; width:200; height:200; z-index:1; background-image:url(ole01.jpg);...
0
2271
by: phil cunningham | last post by:
Does anyone know of a good library to handle Polygon clipping in C#. This would require clipping of shapes with FLOAT verteces and we need the capability of clipping one Polygon against another to get Interseciton, Union etc. Any information would be much appreciated. Thanks Phil
4
3277
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any errors. After reading the ole object from db, I saved it to C: as file1.bmp and displayed on the web. But it can not be displayed. After I manually sent...
2
1533
by: Pugi! | last post by:
I am currently experimenting a bit with clipping (with banners). 1. Is it possible to do more then one clipping on a image. For example: image of 400px x 80 px: var TELLER = 0; function unfoldPic() { TELLER++; if (TELLER <= 80) { CURR_PIC.style.clip = 'rect(0px 400px ' + TELLER + 'px 0px)'; window.setTimeout('unfoldPic()', 30); }
9
3401
by: Andy Baxter | last post by:
hello, I'm writing a panoramic image viewer in html / javascript. The idea is I have a div with two identical panoramic photographs embedded in it. The clipping on the div is set to make it a viewport onto the images. Then I use javascript to make the two images scroll through the viewport - the second image is just there to fill the gaps...
4
6709
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my code ?? thank you Pedro Leite From Portugal ------------------------------------
0
1330
by: dongarbage | last post by:
Hi there, I have a panel that I'm trying to draw lines on based on mouse events. I'm using a Graphics object to do this. However, the region that the graphics object will draw lines in is different in size than the panel size. I'd like the graphics object's clipping region (is "clipping region" the right terminology?) to be the same size as...
6
4329
by: Serdar C. | last post by:
hi there. i am developing a web based application in c# and asp.net. in my application the server have a large WMV file i.e about 6 hours long. i want to make sure that clients can download portions of that file. i.e. the client may want to download video part from 2h32m00sec to 4h56m03sec. does anyone knows a sourcecode or at least a comand...
0
7948
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8150
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6329
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3682
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3671
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2131
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 we have to send another system
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.