Results 1 to 20 of 20

Thread: Image crop with GDI+

Threaded View

  1. #8

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    809

    Re: Image crop

    Quote Originally Posted by jpbro View Post
    If you're using the code I provide to set the crop rect, there's no need to involve GDI+ at all. Stay with RC6/Cairo and use the CropSurface method to get a new surface at the required coords and save it to disk. Something like:

    Code:
    mo_SrfOrig.CropSurface(mt_SelRect.Left, _
                                        mt_SelRect.Top, _
                                        mt_SelRect.Right - mt_SelRect.Left, _
                                        mt_SelRect.Bottom - mt_SelRect.Top).WriteContentToJpgFile App.Path & "\cropped.jpg"
    tks. I already have a working model using GDI+ to save and view images and works well.

    What i am looking to do is have a list of images. then i can right click each one and the crop form appears. I select the portion i want from Left image. On right i have the cropped image from the original file
    showing. if i am happy then click ok. the coordinates are then saved for processing.

    Once i am ready, i can process all files and either resize the whole image if not cropped or if an image is cropped resize the cropped image.

    but its always worth knowing another method.

    are there other save as methods like WriteContentToJpgFile, can it save to PNG, Tif,Gif,BMP etc or is it just that one

    Just tried .WriteContentToGifFile , .WriteContentToBmpFile , .WriteContentToTifFile but these dont work.

    tks
    Last edited by k_zeon; Apr 19th, 2025 at 05:08 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width