Skip to content

Instantly share code, notes, and snippets.

View STOL4S's full-sized avatar

STOLAS STOL4S

  • Arizona
View GitHub Profile
@STOL4S
STOL4S / BitmapRotate.cs
Last active November 26, 2023 16:07
Draw a rotated bitmap image in C# and GDI+ using an existing graphics object
using System.Drawing;
namespace GraphicsHelperLibrary
{
public static class GraphicsHelper
{
public static void DrawRotatedImage(this Graphics G, Bitmap _Image, PointF _Position, float _Rotation)
{
PointF Offset = new PointF(_Image.Width / 2 + _Position.X,
_Image.Height / 2 + _Position.Y);