|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Clipping a pic and saving it in a file in DOT NETIm a newbie I have a picture in a picture box I drag a portion of the picture with the mouse..... Here i get the area i dragged in and now i want that area to be a separate picture saved in my hard disk how do i do that? i got two (x,y) co-ordinates where i started to drag and where i finished dragging... i got the width and height of the portion of the picture how do i get the actual portion of the picture saved as a separate file??? can anyone give me the code for that? thanks in advance Dnia 30-01-2006 o 13:09:18 Dixon <vijaydi***@gmail.com> napisa³:
Show quoteHide quote > Hai 1. Create second Image (Bitmap) with the size of (X2-X1), (Y2-Y1)> > Im a newbie > > I have a picture in a picture box > > I drag a portion of the picture with the mouse..... > > Here i get the area i dragged in and now i want that area to be a > separate picture saved in my hard disk > > how do i do that? > > i got two (x,y) co-ordinates where i started to drag and where i > finished dragging... > > i got the width and height of the portion of the picture > > how do i get the actual portion of the picture saved as a separate > file??? > > can anyone give me the code for that? > [PD] 2. Create Graphics for it (Graphics.FromImage) 3. Draw correct portion of the source graphic to the destination graphic (one of the Graphics.DrawImage methods allows you to do that) 4. Save the destination image (Image.Save) -- Piotr Dobrowolski Piotr.Dobrowolski@_usun_gmail.com It doesnt work out
how do i set the size of the picture object its read only my picture object is a bitmap object ????? Dnia 30-01-2006 o 15:10:56 Dixon <vijaydi***@gmail.com> napisa³:
> It doesnt work out [PD] Bitmap destBitmap = new Bitmap(width,height);> > how do i set the size of the picture object its read only > > my picture object is a bitmap object > -- Piotr Dobrowolski Piotr.Dobrowolski@_usun_gmail.com "Dixon" <vijaydi***@gmail.com> wrote in message Please do not crosspost questions to both .NET and non-.NET groups. The news:1138622958.517469.231480@g47g2000cwa.googlegroups.com... *.vb.* groups are for VB6 and earlier. All .NET groups have "dotnet" in their names.
How to best resize a form?
Using Control Array in User Control Why sending email programmatically must be so complicated? VB 2005 Express..NOT OT...really! Why Randomize() won't work? Proper way to resize a Form VB6---.NET [function LOF] Fails after WordPad saving Passing data from a dll to the main VB program Problems with vbCtrlMask |
|||||||||||||||||||||||