Click here to Skip to main content
15,919,341 members
Home / Discussions / C#
   

C#

 
AnswerRe: xml file vs .config Pin
PIEBALDconsult9-Sep-09 6:43
mvePIEBALDconsult9-Sep-09 6:43 
AnswerRe: xml file vs .config Pin
vivasaayi11-Sep-09 1:00
vivasaayi11-Sep-09 1:00 
QuestionNetwork usage [modified] Pin
Jacobb Michael8-Sep-09 23:25
Jacobb Michael8-Sep-09 23:25 
AnswerRe: Network usage Pin
Dave Kreskowiak9-Sep-09 6:41
mveDave Kreskowiak9-Sep-09 6:41 
GeneralRe: Network usage Pin
Jacobb Michael9-Sep-09 22:44
Jacobb Michael9-Sep-09 22:44 
AnswerRe: Network usage Pin
carlecomm21-Sep-09 21:55
carlecomm21-Sep-09 21:55 
QuestionImage Crop Issue [modified] Pin
Programm3r8-Sep-09 23:14
Programm3r8-Sep-09 23:14 
QuestionRe: Image Crop Issue Pin
Programm3r8-Sep-09 23:55
Programm3r8-Sep-09 23:55 
Ok, so the new method doesn't cause an exception.

But the new cropped image's position is a bit out. It crops more to the right. What am I doing wrong?

public static Bitmap CropBitmap(Bitmap srcBitmap, int cropX, int cropY, int cropWidth, int cropHeight)
{
    // Create the new bitmap and associated graphics object
    Bitmap bmp = new Bitmap(cropWidth, cropHeight);

    Graphics g = Graphics.FromImage(bmp);
    // Draw the specified section of the source bitmap to the new one
    g.DrawImage(srcBitmap, new Rectangle(0, 0, cropWidth, cropHeight), cropX, cropY, cropWidth, cropHeight, GraphicsUnit.Pixel);
    // Clean up
    g.Dispose();

    // Return the bitmap
    return bmp;
}


Thanks again.
Kind regards,


The only programmers that are better C# programmers, are those who look like this -> Green Alien | [Alien]



Java | [Coffee] Programm3r

My Blog: ^_^

AnswerRe: Image Crop Issue Pin
carlecomm21-Sep-09 21:49
carlecomm21-Sep-09 21:49 
AnswerRe: Image Crop Issue Pin
Rob Smiley8-Sep-09 23:56
Rob Smiley8-Sep-09 23:56 
GeneralRe: Image Crop Issue Pin
Programm3r9-Sep-09 0:14
Programm3r9-Sep-09 0:14 
GeneralRe: Image Crop Issue Pin
Rob Smiley9-Sep-09 0:36
Rob Smiley9-Sep-09 0:36 
QuestionRe: Image Crop Issue Pin
Programm3r9-Sep-09 1:35
Programm3r9-Sep-09 1:35 
AnswerRe: Image Crop Issue Pin
Luc Pattyn9-Sep-09 1:47
sitebuilderLuc Pattyn9-Sep-09 1:47 
GeneralRe: Image Crop Issue Pin
Programm3r9-Sep-09 1:54
Programm3r9-Sep-09 1:54 
AnswerRe: Image Crop Issue Pin
Rob Smiley9-Sep-09 2:22
Rob Smiley9-Sep-09 2:22 
GeneralRe: Image Crop Issue Pin
Programm3r9-Sep-09 2:54
Programm3r9-Sep-09 2:54 
QuestionProblem Sending Message from SERVER to CLIENT Pin
muhammad_umair8-Sep-09 23:09
muhammad_umair8-Sep-09 23:09 
AnswerRe: Problem Sending Message from SERVER to CLIENT Pin
monstale8-Sep-09 23:45
monstale8-Sep-09 23:45 
GeneralRe: Problem Sending Message from SERVER to CLIENT Pin
muhammad_umair9-Sep-09 0:19
muhammad_umair9-Sep-09 0:19 
GeneralRe: Problem Sending Message from SERVER to CLIENT Pin
monstale9-Sep-09 0:52
monstale9-Sep-09 0:52 
GeneralRe: Problem Sending Message from SERVER to CLIENT Pin
muhammad_umair9-Sep-09 1:43
muhammad_umair9-Sep-09 1:43 
GeneralRe: Problem Sending Message from SERVER to CLIENT Pin
monstale9-Sep-09 2:30
monstale9-Sep-09 2:30 
GeneralRe: Problem Sending Message from SERVER to CLIENT Pin
muhammad_umair9-Sep-09 2:44
muhammad_umair9-Sep-09 2:44 
GeneralRe: Problem Sending Message from SERVER to CLIENT Pin
J4amieC9-Sep-09 2:54
J4amieC9-Sep-09 2:54 

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.