Sorry for the multipost... but can any one help me with this?
I am trying to get the union rectangle from Vobjects in multilayer viewer. I wrote these code but it just does not solve the problem...
Dim pRect As New RectangleF
For Each pObj As Aurigma.GraphicsMill.WinControls.ImageVObject In Me.Canvas.CurrentLayer.VObjects
If pRect.Width = 0 Then
pRect = pObj.GetControlPointsBounds
Else
pRect = System.Drawing.RectangleF.Union(pRect, pObj.GetControlPointsBounds)
End If
Next
Me.Canvas is Multilayerviewer and would like to get the rectangle so I can crop the image without extra transparent area.
Thank you very much, Alex. I really do appreciate your reply.
Here is further question...
Is there any way to avoid 1 pixel transparent edge for cropping? or detect no-transparent area as rectangle??
Here is whats happening...
The vobjects in the multilayer measured in point, converting it to the pixel measurement, there would be a difference between the exact position (in pixel) in the image and the position in point, which finally causes the wrong cropping of the image.
When you move, resize, rotate vobjects, the difference varies. Is assume this is based on the resolution difference between 72 dpi and 96 dpi. The smaller size you resize in the screen to, the difference is much bigger...
Please give me some idea to avoid this wrong cropping...
I am programming PNG/GIF graphic tool for web developer and they are critical on 1 pixel difference...