📄 jpgapi.htm
字号:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Author" CONTENT="Lingsong He">
<META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en]C-NECCK (Win95; I) [Netscape]">
<META NAME="Description" CONTENT="Support FoxPro, Vb, Vc and others to show a JPEG file by only a JPG api.">
<META NAME="KeyWords" CONTENT="foxpro,JPG,JPEG,api,dll">
<TITLE>Win32 JPG Api</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000" BACKGROUND="back1.jpg">
<CENTER> </CENTER>
<TABLE BORDER=0 WIDTH="697" HEIGHT="100" >
<TR>
<TD><IMG SRC="empty.gif" HEIGHT=20 WIDTH=101></TD>
<TD>
<CENTER><B><FONT COLOR="#CC0000"><FONT SIZE=+2>Win32 JPG Api</FONT></FONT></B></CENTER>
<HR ALIGN=LEFT WIDTH="100%">I have been looking for a long time for a JPEG
package that will allow me to show a JPEG file in my program, espically
in FoxPro. I never found one that didn't cost hundreds of dollars and didn't
need complicated programming. Thanks for excellent works of Independent
JPEG Group's software of IJG JPEG library and thanks for CHRISDL@PAGESZ.NET's
MFC examples, I wrote a win32 JPG api dll by my myself.
You can call it to show a JPG file in your program by only one sentence:
<FONT COLOR="#3333FF">showjpg(fliename,hwnd,left,top). </FONT><FONT COLOR="#000000">No
more is needed to know.</FONT><FONT COLOR="#3333FF"> </FONT>Below is a
screen shot of a form of VFP5.0:
<BR><FONT COLOR="#FFFFFF">.</FONT>
<CENTER><IMG SRC="jpgapi.jpg" HEIGHT=300 WIDTH=340></CENTER>
<FONT COLOR="#FFFFFF">.</FONT>
<BR><FONT COLOR="#CC0000"><B>Win32 JPG API is composed of only four functions:</B> </FONT>
<BR><B><FONT COLOR="#3333FF">1. long showjpg(char *fliename, long hwnd,
long left, long top)</FONT></B>
<BR><FONT COLOR="#000000">This function show a JPG file in a window at
(left,top). Here hwnd is handle of the window. If return 1, then all is
ok.</FONT>
<BR><FONT COLOR="#000000">Example: rs=showjpg("c:\jpgdemo\demo.jpg",hwnd,10,10)</FONT>
<BR><B><FONT COLOR="#3333FF">2. long jpg_to_bmp(char *jpgfilename,
char *bmpfilename)</FONT></B>
<BR><FONT COLOR="#000000">This function copy a JPG file to a BMP file.
VB, VC, and FoxPro support BMP, so you can also show a JPG file by this
way.</FONT> <FONT COLOR="#000000">If return 1, then all is ok.</FONT>
<BR><FONT COLOR="#000000">Example: rs=jpg_to_bmp("c:\jpgdemo\demo.jpg","c:\temp\demo.bmp")</FONT>
<BR><B><FONT COLOR="#3333FF">3. long to_clip(long hwnd, long type)</FONT></B>
<BR><FONT COLOR="#000000">This function copy a screen shot of a window(like
above) to the clipboard, then you can paste it to any picture program to
edit. Here type is type of copy(0=all window,1=client area).</FONT>
<BR><FONT COLOR="#000000">Example: rs=to_clip(hwnd,0)</FONT>
<BR><B><FONT COLOR="#3333FF">4. long copy_to_bmp(long hwnd, char *bmpfilename,
long type)</FONT></B>
<BR><FONT COLOR="#000000">This function copy a screen shot of a window
to a BMP file. Here type is type of copy(0=all window,1=client area).</FONT>
<BR><FONT COLOR="#000000">Example: rs=copy_to_bmp("c:\temp\demo.bmp",hwnd,0)</FONT>
<BR><FONT COLOR="#FFFFFF">.</FONT>
<BR><B><FONT COLOR="#CC0000">Its usage is vary simple. Below is a example
of how to use it in Visual FoxPro. The form is like above. </FONT></B>
<BR><B><FONT COLOR="#3333FF">1.Init of form </FONT><FONT COLOR="#FF6600"><FONT SIZE=-1>(Declare
JPG Functions in foxjpg.exe)</FONT></FONT></B>
<BR>SET Library TO "c:\foxjpg\Foxtools.fll"
<BR>DECLARE long showjpg IN "c:\foxjpg\jpg.exe";
<BR>STRING name, long hwnd, long l, long t
<BR>DECLARE long jpg_to_bmp IN "c:\foxjpg\jpg.exe";
<BR>STRING name, STRING name1
<BR>DECLARE long showjpg IN "c:\foxjpg\jpg.exe";
<BR>STRING name, long hwnd, long l, long t
<BR>DECLARE long copy_to_bmp IN "c:\foxjpg\jpg.exe";
<BR>long hwnd, STRING name, long area
<BR><FONT COLOR="#000000">DECLARE long to_clip IN "c:\foxjpg\jpg.exe";</FONT>
<BR><FONT COLOR="#000000">long hwnd, long area</FONT>
<BR><B><FONT COLOR="#3333FF">2.Click of Show Button </FONT><FONT COLOR="#FF6600"><FONT SIZE=-1>(Show
a JPG file in form)</FONT></FONT></B>
<BR>hwnd=_whtohwnd(_WGetPort( ))
// Get handle of this form
<BR>=showjpg("c:\foxjpg\mountain.jpg",hwnd,10,8)
// Show picture at (x=10,y=8)
<BR><B><FONT COLOR="#3333FF">3.Click of Copy Button </FONT><FONT COLOR="#FF6600"><FONT SIZE=-1>(Copy
Form to Clipboard)</FONT></FONT></B>
<BR><FONT COLOR="#000000">hwnd=_whtohwnd(_WGetPort( ))</FONT>
<BR><FONT COLOR="#000000">=to_clip(hwnd,0)</FONT>
<BR><B><FONT COLOR="#3333FF">4.Click of CopyTo Button </FONT><FONT COLOR="#FF6600"><FONT SIZE=-1>(Copy
Form to a BMP file)</FONT></FONT></B>
<BR><FONT COLOR="#000000">hwnd=_whtohwnd(_WGetPort( ))</FONT>
<BR><FONT COLOR="#000000">=copy_to_bmp(hwnd,"c:\foxjpg\demo.bmp",0) </FONT>
<BR><B><FONT COLOR="#3333FF">5.Click of SaveAs Button </FONT><FONT COLOR="#FF6600"><FONT SIZE=-1>(Save
a JPG file as a BMP file)</FONT></FONT></B>
<BR><FONT COLOR="#000000">=jpg_to_bmp("c:\foxjpg\cloud.jpg","c:\foxjpg\cloud.bmp")</FONT>
<BR><B><FONT COLOR="#3333FF">6.Click of Close </FONT><FONT COLOR="#FF6600"><FONT SIZE=-1>(Close
form)</FONT></FONT></B>
<BR>clear dlls
<BR>thisform.release
<BR><FONT COLOR="#FFFFFF">.</FONT>
<BR><B><FONT COLOR="#000000"><A HREF="jpgapi.zip">Download a JPGAPI32(160KB)</A> </FONT><FONT COLOR="#FF6600"><FONT SIZE=-1>
(need mfc42d.dll) </FONT></FONT></B>
<BR><FONT COLOR="#FFFFFF">.</FONT>
<BR><B><FONT COLOR="#CC0000">Shareware Registration </FONT></B>
<BR>If you want to remove the unregister message, you can register
the software by paying to me US$20. This will encourage me to keep on
developing new programs and enhancing the old ones. My email is:
<A HREF="heliso@public.wuhan.cngb.com">heliso@public.wuhan.cngb.com</A>
<BR>.
<DIV ALIGN=right><B><A HREF="http://www.userworld.com/users/hlingso/remote.htm">Return </A></B></DIV>
<HR ALIGN=LEFT WIDTH="100%">
<CENTER>1998.12.20</CENTER>
</TD>
</TR>
</TABLE>
<BLOCKQUOTE>
<CENTER> </CENTER>
</BLOCKQUOTE>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -