* Initialize GdiPlus-X library DO LOCFILE("System.App") * Load the image LOCAL loBmp as xfcBitmap loBmp = _screen.system.Drawing.Bitmap.FromFile("C:\original.jpg") * Create a Graphics object associated to the bitmap LOCAL loGfx as xfcGraphics loGfx = _screen.system.Drawing.Graphics.FromImage(loBmp) * Create a SolidBrush with Red Color using alpha for transparency LOCAL loBrush AS xfcBrush *loBrush = _screen.system.Drawing.SolidBrush.New( _screen.system.Drawing.COLOR.FromRgb(255,0,0)) loBrush = _screen.system.Drawing.SolidBrush.New( _screen.system.Drawing.COLOR.FromARgb(100,255,0,0)) * loBrush = _screen.system.Drawing.SolidBrush.New( _screen.system.Drawing.COLOR.Red) * Create a Rectangle in which the rotated text will be drawn LOCAL loRect AS xfcRectangle loRect = _screen.system.Drawing.Rectangle.New(0, 0, loBmp.Width, loBmp.Height) * Get a basic string format object, then set properties LOCAL loStringFormat AS xfcStringFormat loStringFormat = _screen.system.Drawing.StringFormat.New() loStringFormat.ALIGNMENT = _screen.system.Drawing.StringAlignment.CENTER loStringFormat.LineAlignment = _screen.system.Drawing.StringAlignment.CENTER * Create a Font object LOCAL loFont AS xfcFont loFont = _screen.system.Drawing.FONT.New("Verdana",16, _screen.system.Drawing.FontStyle.Regular, _screen.system.Drawing.GraphicsUnit.POINT) * After creating all needed objects, we can apply the rotation * and draw the text * Translate and Rotate loGfx.TranslateTransform(loBmp.Width /2, loBmp.Height /2) loGfx.RotateTransform(-15) && angle of 15 degrees loGfx.TranslateTransform(-loBmp.Width /2, -loBmp.Height /2) * Finally, draw the string loGfx.DrawString("Rotated Text" + CHR(13) + CHR(10) + "GDIPlus-X is COOL !!!", ; loFont, loBrush, loRect, loStringFormat) * Reset Rotation loGfx.ResetTransform() * Save watermarked image to File loBmp.Save("c:\watermarked.jpg", _screen.system.Drawing.Imaging.ImageFormat.Jpeg) * Show created image RUN /N explorer.exe c:\watermarked.jpg