Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. i want to crop an image... picture is in picture box,,

i want to crop an image... picture is in picture box,,

Scheduled Pinned Locked Moved C#
csharpgraphicscsshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maifs
    wrote on last edited by
    #1

    i want to crop an image... picture is in picture box,, iam trying this... but public void CropImage(bool enableImg) { cropEnable = enableImg; if (cropEnable) { Rectangle cropArea = new Rectangle(20, 20, 100, 100); Pic = (Bitmap)CroppingImage(m, cropArea); m = (Bitmap)Pic; Invalidate(); } } public Image CroppingImage(Image img, Rectangle cropArea) { Bitmap bmpImage = new Bitmap(img); Bitmap bmpCrop = bmpImage.Clone(cropArea, bmpImage.PixelFormat); return (Image)(bmpCrop); } and the 2nd one: public Image CropImage(Image img, Rectangle rect) { return ((Bitmap)img).Clone(rect, img.PixelFormat); } private void button1_Click(object sender, EventArgs e) { Rectangle CropRectangle = new Rectangle(100, 100, 100, 100); pbx.Image = CropImage(pbx.Image, CropRectangle); } but a same error is generated. error is this: Error 1 Inconsistent accessibility: parameter type 'I_M_Editor.Rectangle' is less accessible than method 'I_M_Editor.frmEditable.CropImage(System.Drawing.Image, I_M_Editor.Rectangle)' D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 442 22 I'M Editor --------------------------------------------------------------------------------

    maifs

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups