473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

cut the part of Bmp?

Hi:
I want to create Bmp by fellow code,and it good work,

Bitmap bitmap1 = new Bitmap((Image)iData.GetData(DataFormats.Bitmap))

but i want to cut the part of the Bmp now . How to do it ?

for example :

Bitmap bitmap2 = new Bitmap(bitmap1,bitmap1.Width,bitmap1.Height - 100);

but now bitmap2 just is bitmap1,only bitmap2's height is scaled.

THS

Ekey

Nov 15 '05 #1
1 8321
HI,
Try this,
Bitmap bitmap2=new Bitmap(bitmap1.width,bitmap1.height-
100);
Graphics g=Graphics.FromImage(bitmap2);
g.DrawImage(img,new Rectangle
(0,0,bitmap1.width,bitmap1.height-
100),0,0,bitmap1.width,bitmap1.height-
100,GraphicsUnit.Pixel);
g.Save();
bmp.Save("new.bmp",System.Drawing.Imaging.ImageFor mat.Bmp);

HTH,
Nanda
-----Original Message-----
Hi:
I want to create Bmp by fellow code,and it good work,

Bitmap bitmap1 = new Bitmap((Image)iData.GetData (DataFormats.Bitmap))
but i want to cut the part of the Bmp now . How to do it ?

for example :

Bitmap bitmap2 = new Bitmap (bitmap1,bitmap1.Width,bitmap1.Height - 100);
but now bitmap2 just is bitmap1,only bitmap2's height is scaled.
THS

Ekey

.

Nov 15 '05 #2

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

Similar topics

12
by: Jim Cochrane | last post by:
I just google-searched this group and could not find any references to this. I'm trying to figure out how to specify a three-part header with html. For example, left part ...
2
by: JumpinJeff | last post by:
I am about to revamp the most referenced table in my whole database and am unsure the best way to approch it. The table's primary key is also used as a part number for all the items in the table. ...
3
by: ChadDiesel | last post by:
Hello everyone. I need some advice on table structure for a new project I've been given. One of our customers sends us an Excel spreadsheet each week containing their order. Currently, someone...
7
by: Shannan Casteel via AccessMonster.com | last post by:
I have a form for entering part numbers along with the associated quantity for each part. There are 25 Part fields and 25 associated Quantity fields. If I go to record 1 and enter part number 1234...
2
by: maxw_cc | last post by:
Hi to all of you, I was wondering what the Semantics part in C standard is really for? What should be on the constraints part and what should be on the semantics part? Is the implementation...
3
by: blackswift | last post by:
Hello all, I know STL is part of the standard. Is STL a part of C++ language? I heard scanf function is not a part of C. Best regards.
1
by: itfetish | last post by:
I'm just starting out with ASP.net, making a web parts intranet. I'm triyng to get some basic web parts (ascx files) working on a page, I want them to share a variable, 'StaffID' which one part...
1
by: mknoll217 | last post by:
I am recieving this error from my code: The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part identifier...
1
by: tbrogdon | last post by:
I am new to this group and new to DBs. I am building a small DB for my work. We create sheetmetal parts. Each part has a part number (e.g., 1054471 or 50TG508506 - both formats are typical for a...
5
geolemon
by: geolemon | last post by:
I'm building a small-scale MRP system for an electronics manufacturing business. There are assemblies that are built, and parts that go into those assemblies. The individual component parts that go...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
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
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...

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.