From: Henning on

"Paul Clement" <UseAdddressAtEndofMessage(a)swspectrum.com> skrev i
meddelandet news:e62uo5phb6e4mnig79a87ticjse8guqfku(a)4ax.com...
> On Thu, 4 Mar 2010 00:53:10 +0100, "Henning" <computer_hero(a)coldmail.com>
> wrote:
>
>
> � Microsoft has officially dropped support for newsgroups, only supporting
> the
> � new(er) forums. I can therefor not understand why a MVP violates the MS
> � policy by posting in the newsgroups at all? MS wants all support to take
> � place in the forums.
> �
> � /Henning
> �
>
> To which part of the policy are you referring?
>
> http://support.microsoft.com/gp/newswhelp
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)

Hitting the send to early...

The subject for this thread " Is there a way.......in VB6"!!

/Henning


From: Karl E. Peterson on
Tony Girgenti wrote:
> OK. That's the problem. I was using 'modFreeImage.bas' instead of
> 'MFreeImage.bas'.
>
> The test program executes now. However, i tested it using one of my .tif
> files and it produced an empty output file.
>
> Does anybody have an example of how to use this wrapper from VB or how to
> use the 'FreeImage_SetOutputMessage' function in VB or a sample VB program
> using FreeImage?

What'd you try? Seems like you're working too hard. For me to save a
TIF as a JPG, I just started a new project, and added the
MFreeImage.bas file along with this code:

Public Sub Main()
Dim pic As StdPicture
Const path As String = "D:\Images\Misc\Random\"
Set pic = LoadPictureEx(path & "Ann3.tif")
Debug.Print SavePictureEx(pic, path & "Ann3.jpg", FIF_JPEG,
FISO_JPEG_QUALITYGOOD)
End Sub

Worked on the first try. I even had full Intellisense for the optional
parameters.

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Tony Girgenti on
I simply copied a.tif file to the test folder and renamed it to test.tif. I
didn't change anything in the TestFreeImage project.

After doing more reading and testing, i realized that our tif files are all
multipage files. That is an issue i will have to work on.

I will try your method with my tif file. The test program is using
FreeImage_Load(FIF_TIFF, "test.tif", 0). I have no idea of how to determine
which method or function to use to convert my .tif images. The test program
shows one way and you are using a different function.

Another problem i was having, is the test program could not find the
test.tif file in it's own folder. I had to put the whole path(C:\...) in
the FreeImage_Load statement in order for it to find it.

Thanks,
Tony

"Karl E. Peterson" wrote:

> Tony Girgenti wrote:
> > OK. That's the problem. I was using 'modFreeImage.bas' instead of
> > 'MFreeImage.bas'.
> >
> > The test program executes now. However, i tested it using one of my .tif
> > files and it produced an empty output file.
> >
> > Does anybody have an example of how to use this wrapper from VB or how to
> > use the 'FreeImage_SetOutputMessage' function in VB or a sample VB program
> > using FreeImage?
>
> What'd you try? Seems like you're working too hard. For me to save a
> TIF as a JPG, I just started a new project, and added the
> MFreeImage.bas file along with this code:
>
> Public Sub Main()
> Dim pic As StdPicture
> Const path As String = "D:\Images\Misc\Random\"
> Set pic = LoadPictureEx(path & "Ann3.tif")
> Debug.Print SavePictureEx(pic, path & "Ann3.jpg", FIF_JPEG,
> FISO_JPEG_QUALITYGOOD)
> End Sub
>
> Worked on the first try. I even had full Intellisense for the optional
> parameters.
>
> --
> ..NET: It's About Trust!
> http://vfred.mvps.org
>
>
> .
>
From: Karl E. Peterson on
Tony Girgenti wrote:
> I simply copied a.tif file to the test folder and renamed it to test.tif. I
> didn't change anything in the TestFreeImage project.
>
> After doing more reading and testing, i realized that our tif files are all
> multipage files. That is an issue i will have to work on.

Ah, I had forgotten that detail. Not sure I have any such critters to
test with, here.

> I will try your method with my tif file. The test program is using
> FreeImage_Load(FIF_TIFF, "test.tif", 0). I have no idea of how to determine
> which method or function to use to convert my .tif images. The test program
> shows one way and you are using a different function.

SavePictureEx is just a glorified wrapper around a bunch of
functionality.

> Another problem i was having, is the test program could not find the
> test.tif file in it's own folder. I had to put the whole path(C:\...) in
> the FreeImage_Load statement in order for it to find it.

That makes sense. (I'd guess the CurDir was pointing somewhere else.)
Short-story: If you rely on shortcuts, plan on getting lost.

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Karl E. Peterson on
Tony Girgenti wrote:
> I simply copied a.tif file to the test folder and renamed it to test.tif. I
> didn't change anything in the TestFreeImage project.
>
> After doing more reading and testing, i realized that our tif files are all
> multipage files. That is an issue i will have to work on.
>
> I will try your method with my tif file. The test program is using
> FreeImage_Load(FIF_TIFF, "test.tif", 0). I have no idea of how to determine
> which method or function to use to convert my .tif images.

Take a look at the "Multipage functions" section in the PDF. (It's on
p55 in the v3.13.1 document I have.) Looks to me like you'll wnat to
use FreeImage_OpenMultiBitmap to open your files. You'll then be able
to call FreeImage_GetPageCount to confirm how many pages you have.

Now, iterate each page, calling FI_LockPage to get a handle to the
individual bitmap on that page, save it to wherever you want, then call
FI_UnlockPage on that page to release it.

That should be the general idea.

--
..NET: It's About Trust!
http://vfred.mvps.org