Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem converting a BMP to a JPG on the fly

Status
Not open for further replies.

tedsmith

Programmer
Joined
Nov 23, 2000
Messages
1,762
Location
AU
I have been having problems trying to convert a BMP to a JPG without going through the step of saving it to disk.
I tried the example in thread222-1335999: How do I convert a BMP to JPG stream (that is now closed) but get errors depending on what version of the GDI library I used.

In the example,
GDI+ Type Library 1.31 (6/2/2003) gives "Sub or function not found" on the statement
Set myStream = CreateStreamOnHGlobal(b(0), True)
whereas,
GDI+ Type Library 1.05 (11/9/2003) gives "Cant find project or library" on the line
Private Function GetEncoderCLSID(ByVal strMimeType As String, outCLSID As CLSID) As Long
What did I do wrong?
I tried various manipulations of the CreateStreamOnHGlobal without success.
Maybe I have the wrong or conflicting references entered?
Any help would be greatly appreciated.
 
Ted,

I think I've found the problem. You need to go here to download OLELIB.TLB - OLE interfaces & functions v1.7

Register both the included libraries, then add a reference in your project to Edanmo's OLE interfaces and functions v1.81[\b].


Basically I originally used the API's CreateStreamOnHGlobal, but couldn't get it working reliably so started testing with the Edanmo type library which worked fine - but forgot to update my documentation ...

Note that a tlb does not need to be redistributed with your application
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top