Error in Merge function

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

Post Reply
D-Off
Posts: 3
Joined: Fri May 18, 2007 1:59 pm
Contact:

Error in Merge function

Post by D-Off »

I find a error in function Merge (GflAx Light Library 2.70). For example, make the project in VB.NET, create a form:

Code: Select all

Public Class Form1
    Dim gf As New GflAx.GflAx

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        gf.LoadBitmap("C:\test1.jpg")
        gf.MergeAddFile("C:\pr.jpg", 50, 10, 10)
        gf.Merge()
        gf.MergeClear()
    End Sub
End Class
The files 100% exist and way correct. Other functions works normally, but gf.Merge except a error (screenshot)
Exception details:
System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2147467259
Message="Bad parameters"
Source="GflAx.GflAx.1"
StackTrace:
in GflAx.GflAxClass.Merge()
in Merge.Form1.Form1_Load(Object sender, EventArgs e) in C:\My Documents\Visual Studio 2005\Projects\Merge\Merge\Form1.vb:line 7
in System.EventHandler.Invoke(Object sender, EventArgs e)
in System.Windows.Forms.Form.OnLoad(EventArgs e)
in System.Windows.Forms.Form.OnCreateControl()
in System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
in System.Windows.Forms.Control.CreateControl()
in System.Windows.Forms.Control.WmShowWindow(Message& m)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
in System.Windows.Forms.ContainerControl.WndProc(Message& m)
in System.Windows.Forms.Form.WmShowWindow(Message& m)
in System.Windows.Forms.Form.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
in System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
in System.Windows.Forms.Control.SetVisibleCore(Boolean value)
in System.Windows.Forms.Form.SetVisibleCore(Boolean value)
in System.Windows.Forms.Control.set_Visible(Boolean value)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.Run(ApplicationContext context)
in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
in Merge.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:строка 81
in System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()
Can be, I something do not so?
D-Off
Posts: 3
Joined: Fri May 18, 2007 1:59 pm
Contact:

Next problem

Post by D-Off »

Excuse me, I have wrong understood, what use this function. But now appeared other problem. See the source code and results:

Code: Select all

Dim gf As New GflAx.GflAx

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        gf.NewBitmap(300, 200)
        gf.MergeAddFile("a.jpg", 50, 0, 0)
        gf.MergeAddFile("b.jpg", 50, 0, 0)
        gf.Merge()
        gf.MergeClear()
        PictureBox1.Image = Image.FromHbitmap(gf.GetPicture.Handle)
        gf.SaveFormat = GflAx.AX_SaveFormats.AX_BMP
        gf.SaveBitmap(System.Environment.CurrentDirectory & "\outGFL.bmp")
        PictureBox1.Image.Save(System.Environment.CurrentDirectory & "\outPB.bmp")
    End Sub
Such scene appears here is In PictureBox1:
Image
But GflAx it is correct saves:
Image
Why such different results?
Post Reply