I am getting OutOfMemory exception for even i am not customizing any thing and it crashing my application
Some time it give the error of 2-3 operation and sometime it give error after many operation did.
Thanks,
Nirav
Thank you Dess!!!!!
That works.
I laughed when I saw the last GIF. So many rectangles. Lol.
Thank you!!!
Excuse my ignorance...
I added your code to the project and I still get the out of memory error. Attached is the updated RadForm1. It is not calling the override at all. Maybe because I am not calling DrawShape?
Thank you for your help!!!
The main thing is that you can duplicate it. If I need to wait for an update that is okay. I can tell people to just 2 to 3 things max for now.
I have also updated your Telerik points.
Currently, the possible solution that I can suggest is to use the following custom RadImageEditor:
Public
Class
CustomImageEditor
Inherits
RadImageEditor
Protected
Overrides
Function
CreateImageEditorElement()
As
RadImageEditorElement
Return
New
CustomImageEditorElement()
End
Function
End
Class
Public
Class
CustomImageEditorElement
Inherits
RadImageEditorElement
Public
Overrides
Sub
DrawShape(shape
As
Drawing2D.GraphicsPath, fill
As
Color, stroke
As
Color, borderThickness
As
Integer
)
If
Me
.CurrentBitmap
Is
Nothing
Then
Me
.OpenImage()
Return
End
If
Dim
destRect
As
Rectangle =
New
Rectangle(0, 0,
Me
.OriginalBitmap.Width,
Me
.OriginalBitmap.Height)
Dim
destImage
As
Bitmap =
New
Bitmap(
Me
.OriginalBitmap.Width,
Me
.OriginalBitmap.Height)
destImage.SetResolution(
Me
.OriginalBitmap.HorizontalResolution,
Me
.OriginalBitmap.VerticalResolution)
Using graphics
As
Graphics = graphics.FromImage(destImage)
graphics.CompositingMode = CompositingMode.SourceCopy
graphics.CompositingQuality = CompositingQuality.HighQuality
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic
graphics.SmoothingMode = SmoothingMode.HighQuality
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality
graphics.DrawImage(
Me
.OriginalBitmap, destRect, 0, 0,
Me
.OriginalBitmap.Width,
Me
.OriginalBitmap.Height, GraphicsUnit.Pixel)
Using brush
As
SolidBrush =
New
SolidBrush(fill)
Using pen
As
Pen =
New
Pen(stroke, borderThickness)
graphics.CompositingMode = CompositingMode.SourceOver
graphics.FillPath(brush, shape)
graphics.DrawPath(pen, shape)
End
Using
End
Using
End
Using
Me
.CurrentBitmap.Dispose()
Me
.CurrentBitmap =
Nothing
Me
.CurrentBitmap =
CType
(destImage.Clone(), Bitmap)
destImage.Dispose()
Me
.Invalidate()
End
Sub
End
Class
Regards,
Dess | Tech Support Engineer, Sr.
Progress TelerikRadImageEditor for Winforms