I wanted to rotate a drone image to set it in line with the heading, and then plot them on Google Earth using a KML file.
The drone data is in the exif file which one can extract with Phil Harvey's excellent Exiftool. Link. It has way more information that meta-extractor code.
The KML code was reasonably simple, leaving images and tracks on Google earth.
But what has proved very hard to sort out is rotating the image.
Obviously when the rectangular image is rotated the edges exceed the view and get cut off. So one needs to work out the maximum size of the new shape with trig, and then shrink the image to fit the fit the view, and save it as a neat rectangle. This all worked.
At the same time one has to move the centre of the image. This all proved to be quite hard to get it to be consistent so I moved to plan B.
Plan B was to try BitMapCreator because there appears to be a rotate and transform function, and I had not played with it.
There is an example here Link but what is the "source" in the CreateDrawTask. I have tried a few things but get lots of error messages.
Thanks for any guidance. And of course if I am in the wrong direction then do say.
The drone data is in the exif file which one can extract with Phil Harvey's excellent Exiftool. Link. It has way more information that meta-extractor code.
The KML code was reasonably simple, leaving images and tracks on Google earth.
But what has proved very hard to sort out is rotating the image.
Obviously when the rectangular image is rotated the edges exceed the view and get cut off. So one needs to work out the maximum size of the new shape with trig, and then shrink the image to fit the fit the view, and save it as a neat rectangle. This all worked.
At the same time one has to move the centre of the image. This all proved to be quite hard to get it to be consistent so I moved to plan B.
Plan B was to try BitMapCreator because there appears to be a rotate and transform function, and I had not played with it.
There is an example here Link but what is the "source" in the CreateDrawTask. I have tried a few things but get lots of error messages.
B4X:
Dim dt As DrawTask = bc.CreateDrawTask(source, SrcRect, 50, 50, True) '(50, 50) defines the target center
dt.SrcScaleX = 2.5
dt.SrcScaleY = 3
dt.Degrees = 180
bc.DrawBitmapCreatorTransformed(dt)
Thanks for any guidance. And of course if I am in the wrong direction then do say.