Re: Add tags to jpg files

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Feb 7, 7:49 am, "Rotsey" <malcolm_sm...@xxxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
Hi,

Anyone know how to add Tags to JPG files using C# or VB.NET in Vista???

I have a XP dev box so I want to do dev it from there?

Malcolm

Are you meaning adding texts onto image and saving them?
If so, drawstring function does that under GDI+

Sample code i've done:
-Just change <your_text> string:-

Dim mypicture As Bitmap
mypicture = New Bitmap(PictureBox1.Image)

Dim mygraph As Graphics
mygraph = Graphics.FromImage(mypicture)
'create a new brush with a single, solid color
Dim myBrush As New SolidBrush(Color.Red)

'create a new basic font. you can mess around and make it cooler
Dim f As Font = New Font(Font.Bold, 20)

'draw the string onto the form.
' Location is 100(x), 33(y), you may change
mygraph.DrawString("<your_text>", New Font("Arial", 18,
FontStyle.Regular), Brushes.Red, 0, 10)

PictureBox1.Image = mypicture

mygraph.Dispose()


Then save using:
PictureBox1.Image.Save(<path>)

I was searching this code with no help in group, other external sites
provides similar solutions for that purpose.

Hope this helps.
.



Relevant Pages

  • Picturebox & StretchBlt
    ... Dim lWidth As Long ... Dim lHeight As Long ... Dim myPicture as StdPicture ...
    (microsoft.public.vb.winapi.graphics)
  • RE: dev connections work, test does not
    ... OK, I've tried many scenarios, they all work on DEV, and not on TEST. ... Dim cn As ODBCConnection ... > Dim crTables As Tables ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: getting the wrong path (wrong PC!)
    ... It works fin on the dev box but ... > corpmis100973n3 is my box and this code errored on the live server. ... > Dim StackFrame As New StackFrame ... > Dim contents As String ...
    (microsoft.public.dotnet.framework.aspnet)