Image resize and rotate [message #677404] |
Wed, 08 June 2011 08:27  |
Eclipse User |
|
|
|
Hello,
I'm trying to rotate an Image (GraphicsAlgorithm extension) that I create with the following code (mainly taken from your tutorial):
ContainerShape containerShape = peCreateService.createContainerShape(targetDiagram, true);
GraphicsAlgorithm visibleGA;
Rectangle invisibleRectangle;
{
invisibleRectangle = gaService.createRectangle(containerShape);
gaService.setLocationAndSize(invisibleRectangle, context.getX(), context.getY(), width + 2*xBorder, height + 2*yBorder);
Image visibleGA = gaService.createImage(container, SLDImageProvider.IMG_CONTACTOR);
visibleGA.setStretchH(true);
visibleGA.setStretchV(true);
visibleGA.setProportional(true);
gaService.setLocationAndSize(visibleGA, xBorder, yBorder, width, height);
}
This code does not seem to enable the resizing of the Image nor the stretching of the image to the height and width dimensions.
Could you possibly help me understand how to allow the resizing?
Also I'd like to understand how to rotate the image: if there is standard way to do this, could you give a example please?
Thank you very much.
S
|
|
|
|
|
|
|
Re: Image resize and rotate [message #1050355 is a reply to message #1048332] |
Fri, 26 April 2013 23:23  |
Eclipse User |
|
|
|
this is image rotate.
Imports System.IO
Imports System.Drawing.Printing
Imports RasterEdge.Imaging
Imports RasterEdge.Imaging.Processing
Dim Image As New RasterEdgeImaging()
Public Sub RotateImage()
If True Then
Dim LoadImage As New Bitmap("C:\\1.bmp")
Dim rotate As Graphics = Graphics.FromImage(LoadImage)
rotate.TranslateTransform(CType(bmp.Width, Single) / 2, CType(bmp.Height, Single) / 2)
rotate.RotateTransform(rotationAngle)
rotate.TranslateTransform(-CType(bmp.Width, Single) / 2, -CType(bmp.Height, Single) / 2)
rotate.InterpolationMode = InterpolationMode.HighQualityBicubic
rotate.DrawImage(img, New Point(0, 0))
rotate.Dispose()
Return LoadImage()
End If
End Sub
|
|
|
Powered by
FUDForum. Page generated in 0.04759 seconds