Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
GeneralRe: String Problem Pin
pinna_hari18-May-08 23:15
pinna_hari18-May-08 23:15 
GeneralRe: String Problem Pin
DaveyM6918-May-08 23:33
professionalDaveyM6918-May-08 23:33 
AnswerRe: String Problem Pin
KennyPatel17-May-08 5:12
KennyPatel17-May-08 5:12 
AnswerRe: String Problem Pin
Ravi Bhavnani17-May-08 8:08
professionalRavi Bhavnani17-May-08 8:08 
QuestionWMI Help Pin
StevenWalsh17-May-08 4:48
StevenWalsh17-May-08 4:48 
AnswerRe: WMI Help Pin
Mircea Puiu17-May-08 21:15
Mircea Puiu17-May-08 21:15 
QuestionCorp a selection from Image? Pin
jamilkhan00717-May-08 4:47
jamilkhan00717-May-08 4:47 
AnswerRe: Corp a selection from Image? Pin
Anthony Mushrow17-May-08 7:03
professionalAnthony Mushrow17-May-08 7:03 
Corped? Do you mean croped?

I wouldn't bother locking the bits and doing it that way, i would just use GDI+ to draw to a new bitmap, like this:
Bitmap image = ...;
Bitmap newImage = new Bitmap(rect.Width, rect.Height);
Graphics g = Graphics.FromBitmap(newImage);
Rectangle destRect = new Rectangle(0,0, rect.Width, rect.Height);
g.DrawImage(image, destRect, rect, GraphicsUnit.Pixel);
g.Dispose();

then newImage should contain what you want, unless of course your setting your rectangle wrong.

My current favourite word is: I'm starting to run out of fav. words!
-SK Genius

Game Programming articles start -here[^]-

QuestionAddressbook from Outlook 2003 Pin
daniel9917-May-08 4:40
daniel9917-May-08 4:40 
Questionmy Dictionary removal code correct? Pin
George_George17-May-08 3:25
George_George17-May-08 3:25 
AnswerRe: my Dictionary removal code correct? Pin
PIEBALDconsult17-May-08 4:09
mvePIEBALDconsult17-May-08 4:09 
GeneralRe: my Dictionary removal code correct? Pin
George_George17-May-08 4:14
George_George17-May-08 4:14 
GeneralRe: my Dictionary removal code correct? Pin
PIEBALDconsult17-May-08 5:29
mvePIEBALDconsult17-May-08 5:29 
GeneralRe: my Dictionary removal code correct? Pin
George_George17-May-08 21:15
George_George17-May-08 21:15 
GeneralRe: my Dictionary removal code correct? Pin
PIEBALDconsult18-May-08 5:02
mvePIEBALDconsult18-May-08 5:02 
GeneralRe: my Dictionary removal code correct? Pin
George_George19-May-08 1:02
George_George19-May-08 1:02 
GeneralRe: my Dictionary removal code correct? Pin
PIEBALDconsult19-May-08 12:58
mvePIEBALDconsult19-May-08 12:58 
GeneralRe: my Dictionary removal code correct? Pin
George_George20-May-08 4:02
George_George20-May-08 4:02 
GeneralRe: my Dictionary removal code correct? Pin
PIEBALDconsult20-May-08 14:17
mvePIEBALDconsult20-May-08 14:17 
GeneralRe: my Dictionary removal code correct? Pin
George_George21-May-08 0:35
George_George21-May-08 0:35 
AnswerRe: my Dictionary removal code correct? Pin
Guffa17-May-08 6:21
Guffa17-May-08 6:21 
GeneralRe: my Dictionary removal code correct? Pin
George_George17-May-08 21:12
George_George17-May-08 21:12 
GeneralRe: my Dictionary removal code correct? Pin
Guffa18-May-08 1:40
Guffa18-May-08 1:40 
GeneralRe: my Dictionary removal code correct? Pin
George_George18-May-08 1:43
George_George18-May-08 1:43 
AnswerRe: my Dictionary removal code correct? Pin
Roger Alsing17-May-08 7:22
Roger Alsing17-May-08 7:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.