Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim img As New Bitmap("E:\kenan.jpg")
Dim a As String = img.Width / 3
Dim b As String = img.Height / 3
PictureBox1.Image = System.Drawing.Image.FromFile("E:\kenan.jpg")
PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
PictureBox2.SizeMode = PictureBoxSizeMode.Zoom
PictureBox3.SizeMode = PictureBoxSizeMode.Zoom
PictureBox4.SizeMode = PictureBoxSizeMode.Zoom
Dim rc1 As Rectangle = New Rectangle(0, 0, a, b)
Dim newImg1 As Image = img.Clone(rc1, Imaging.PixelFormat.Format32bppArgb)
PictureBox2.Image = newImg1
Dim rc2 As Rectangle = New Rectangle(a, 0, (2 * a), b)
Dim newImg2 As Image = img.Clone(rc2, Imaging.PixelFormat.Format32bppArgb)
PictureBox3.Image = newImg2
Dim rc3 As Rectangle = New Rectangle((2 * a), 0, (3 * a), b)
Dim newImg3 As Image = img.Clone(rc3, Imaging.PixelFormat.Format32bppArgb)-----这里错误!
PictureBox4.Image = newImg3
End Sub
我正在编写一个裁剪图片的程序,可是系统提示错误,说“内存不足”,要怎么改,谢谢。
答案:2 悬赏:0 手机版
解决时间 2021-02-16 02:34
- 提问者网友:疯孩纸
- 2021-02-15 06:08
最佳答案
- 五星知识达人网友:逐風
- 2021-02-15 07:00
你这是用delphi写的吧,真实很少见啊。你试一下单步调试,看一下具体出错的位置。如果程序运行真需要很大的内存,那我建议你把工程弄64位平台。
全部回答
- 1楼网友:迷人又混蛋
- 2021-02-15 08:18
不明白啊 = =!
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯