[mono-vb] Rotating Images

Easy_Rider9999 jhmgbl2 at t-online.de
Sun Aug 16 05:41:46 EDT 2009


The following Code works with .Net framework, but not with Mono! What is
wrong:

Friend Sub RotateImg(ByRef pic As Image, ByVal FileName As String, ByVal
Value As EncoderValue, Optional ByVal BakUpFileName As String = "", Optional
ByRef p As Imaging.PropertyItem = Nothing)
    'Dim pic As Image
    Const Codeloc As String = ClassName & ".RotateImg"
    gStatus = Codeloc & " Start"

    Dim Enc As Encoder = Encoder.Transformation
    Dim EncParms As EncoderParameters = New EncoderParameters(1)
    Dim EncParm As EncoderParameter
    Dim CodecInfo As ImageCodecInfo =
LibPhotoPrinter.clsGrafics.GetEncoderByExt(IO.Path.GetExtension(FileName))


    '// load the image to change
    'pic = Image.FromFile(FileName)




    EncParm = New EncoderParameter(Enc, Value)
    EncParms.Param(0) = EncParm
    If p Is Nothing = False Then
      p.Value = BitConverter.GetBytes(CShort(1))
      pic.SetPropertyItem(p)
    End If
    gStatus = Codeloc & " Save file " & FileName & " CodecInfo " &
CodecInfo.ToString & " Parms " & EncParm.ToString
    pic.Save(FileName, CodecInfo, EncParms)

  End Sub


Regards Hans 
-- 
View this message in context: http://www.nabble.com/Rotating-Images-tp24991859p24991859.html
Sent from the Mono - VB mailing list archive at Nabble.com.



More information about the Mono-vb mailing list