How to draw a specified region of image to specified location ?

T

trant

I have a source Bitmap file, lets call it "src" which is 1200x800 pixels

I want to basically take a small region of src where I specify the starting
x,y points and the width,height and then draw it to my Graphics object at a
specific x,y location.

Would one of the 30 overloaded DrawImage methods do this? I cant really tell
which one would do it
 
P

Peter Duniho

I have a source Bitmap file, lets call it "src" which is 1200x800 pixels

I want to basically take a small region of src where I specify the
starting
x,y points and the width,height and then draw it to my Graphics object
at a
specific x,y location.

Would one of the 30 overloaded DrawImage methods do this? I cant really
tell
which one would do it

Why can't you? The documentation does clearly state the purpose of the
arguments, including which argument specifies the source rectangle for the
drawing, if any.

Here's one example:
http://msdn.microsoft.com/en-us/library/ms142038.aspx

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top