N
Nathan Sokalski
I am trying to write code to rotate a graphic that I have. Here is the code
I am currently using:
Dim frogbitmap As New
Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif")))
Dim froggraphic As Graphics = Graphics.FromImage(frogbitmap)
froggraphic.RotateTransform(90)
frogbitmap.Save(Server.MapPath("images/frog2.gif"), Imaging.ImageFormat.Gif)
However, the file that is output to frog2.gif is exactly the same as
frog.gif. I know that the problem is somewhere in my RotateTransform() code
because when I use the following code:
Dim frogbitmap As New
Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif")))
Dim froggraphic As Graphics = Graphics.FromImage(frogbitmap)
froggraphic.DrawLine(New Pen(Color.HotPink, 10), -1, -1, 47, 47)
frogbitmap.Save(Server.MapPath("images/frog2.gif"), Imaging.ImageFormat.Gif)
The output frog2.gif has the pink line through it as I would expect. What is
it that I am not doing that I need to do with RotateTransform()? Thanks.
I am currently using:
Dim frogbitmap As New
Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif")))
Dim froggraphic As Graphics = Graphics.FromImage(frogbitmap)
froggraphic.RotateTransform(90)
frogbitmap.Save(Server.MapPath("images/frog2.gif"), Imaging.ImageFormat.Gif)
However, the file that is output to frog2.gif is exactly the same as
frog.gif. I know that the problem is somewhere in my RotateTransform() code
because when I use the following code:
Dim frogbitmap As New
Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif")))
Dim froggraphic As Graphics = Graphics.FromImage(frogbitmap)
froggraphic.DrawLine(New Pen(Color.HotPink, 10), -1, -1, 47, 47)
frogbitmap.Save(Server.MapPath("images/frog2.gif"), Imaging.ImageFormat.Gif)
The output frog2.gif has the pink line through it as I would expect. What is
it that I am not doing that I need to do with RotateTransform()? Thanks.