Imports System.Drawing.Image Imports System.IO Imports System.Drawing Imports System.Drawing.Imaging Imports System.Drawing.Drawing2D
Class level declaration
Dim x, y As Integer
Public Sub watermark(ByVal strFileName As String, ByVal text As String, ByVal loc As Integer, ByRef fnt As System.Windows.Forms.FontDialog) Dim FilePath As String = strFileName Dim bmp As Bitmap = System.Drawing.Image.FromFile(FilePath) Dim strWatermark As String = text Dim canvas As Graphics = Graphics.FromImage(resize(bmp, 130, 130)) Dim wmFont As Font, RequiredFontSize As Single ', Ratio As Single Dim tmp As String tmp = FilePath.Substring(FilePath.LastIndexOf("\")) tmp = tmp.Remove(tmp.IndexOf("\"), 1) IO.Directory.CreateDirectory("C:/New") tmp = "C:/New/" & tmp wmFont = fnt.Font place(loc, bmp, RequiredFontSize) canvas.DrawString(strWatermark, wmFont, New SolidBrush(fnt.Color), x, y) bmp.SetResolution(96, 96) bmp.Save(tmp, ImageFormat.Jpeg) canvas.Dispose() bmp.Dispose() End Sub
place method will return the location of watermark..
Public Sub place(ByVal place As Integer, ByRef img As System.Drawing.Image, ByRef fntsize As Integer) Select Case place Case 1 x = 0 y = 0 Case 2 x = Math.Max(CInt((img.Width / 2) - (fntsize / 2)), 0) y = 0 Case 3 x = Math.Max(CInt(img.Width - fntsize), 0) y = 0 Case 4 x = 0 y = Math.Max(CInt(img.Height - fntsize), 0) x = 100 y = 800 Case 5 x = Math.Max(CInt((img.Width / 2) - (fntsize / 2)), 0) y = Math.Max(CInt(img.Height - fntsize), 0) x = 100 y = 800 Case 6 x = Math.Max(CInt(img.Width - fntsize), 0) y = Math.Max(CInt(img.Height - fntsize), 0) End Select End Sub
I guess the place method might not return proper location....change the code according to what u require......
Are you able to help answer this sponsored question?
Questions asked by members who have earned a lot of community kudos are featured in order to give back and encourage quality replies.
write a C++ program which take inputs from the user/keyboard and calculate his ZAKAT.
get the input from user may include
-Amount invested in business
-Amount given to other business partners as loan
-Amount payable to others
I made a prime number finder, it finds the nearest prime that is above and below any integer (Does not work that well with giant numbers.)
Made this in cpp.sh
Why would I need the x=y+1-1;?
x=y; just doesnt seem to work
Why is this?
And I know my coding ...
there are five tables (personTb, addressTb,churchTb) each holds data pertinent to an individual; (personAddress,personChurch) each hold the primary key for the person table and corresponding table IE personAddress holds primary key for addressTb.
both snippets work, my question is; Is my join correctly formatted?
select concat(personTb.p_fName,' ',personTb.p_mName,'. ',personTb.p_lName) ...