473,480 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Cut a selection of a Bitmap

Hello,

how do you select a region (area = x1,y1,x2,y2) of a bitmap and cut or copy
this selection into a new bitmap ?
The original could be a Bitmap object or a Image/PictureBox object.
However, the selected area has to be a new image as I make some Pixel
calculations with the selected area only, while the original image keeps
untouched.

Regards,

André
Nov 15 '05 #1
1 3735
Try using one of the Clone methods on the Bitmap object.
I'm thinking you can use the one that specifies a Rect and
Pixel Format. The Clone returns a new BitMap object with
the specified rectangle.

Should be okay from there to do whatever you want with it.
Just make sure your calling Dispose on these GDI+ objects.
-----Original Message-----
Hello,

how do you select a region (area = x1,y1,x2,y2) of a bitmap and cut or copythis selection into a new bitmap ?
The original could be a Bitmap object or a Image/PictureBox object.However, the selected area has to be a new image as I make some Pixelcalculations with the selected area only, while the original image keepsuntouched.

Regards,

André
.


Nov 15 '05 #2

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

Similar topics

1
1128
by: Jeroen Ceuppens | last post by:
Which methods, classes should I use to become the easiest programming manner? Thx
10
2039
by: Tyrant Mikey | last post by:
I don't know if this can even be done, but I'd REALLY like to eliminate the selection rectangle that appears around my ImageButton controls when the user clicks on them. The buttons are on a black...
8
3293
by: Nathan Sokalski | last post by:
I am trying to write code to rotate a graphic that I have. Here is the code I am currently using: Dim frogbitmap As New Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif"))) Dim...
7
8215
by: Fir5tSight | last post by:
Hi All, I used the following code in C#: using System.Drawing; //blah blah blah Bitmap bmp = new Bitmap();
14
11857
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
8
4287
by: Joergen Bech | last post by:
Suppose I have Dim bm As New Bitmap(16, 16,Imaging.PixelFormat.Format8bppIndexed) I cannot use Dim g As Graphics = Graphics.FromImage(bmdest) Dim hdc As IntPtr = g.GetHdc() as the...
6
2429
by: \Frank\ | last post by:
I trying to learn what a Bitmap is. Not a Managed Bitmap Object but one that, for example, comes from the clipboard with CF_BITMAP. I'm guessing that a CompatableBitmap is an array of indices...
2
2577
by: Peter Oliphant | last post by:
I want to create a new Bitmap which is a portion of an existing Bitmap. For example, if I have a Bitmap that is 100x100 in size I might want to create a new Bitmap that is equivalent to the one...
5
2555
by: =?Utf-8?B?QVRU?= | last post by:
I have a bitmap of 100X100. On the load, the bitmap is created by a function (createimage()). On my OnPaint, I draw the image back to the screen (e.Graphics.DrawImage( bitmap, destrect)). Now,...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6920
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
7106
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...
1
6760
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7022
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...
1
4799
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
3013
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...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
206
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...

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.