VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

請問如何將General類型數據轉成JPG格式文件

 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
Herman



註冊時間: 2004-07-13
文章: 1


第 1 樓

發表發表於: 星期二 七月 13, 2004 5:16 pm    文章主題: 請問如何將General類型數據轉成JPG格式文件 引言回覆

請問如何將General類型數據轉成JPG格式文件,謝謝!
回頂端
檢視會員個人資料 發送私人訊息
syntech



註冊時間: 2003-05-16
文章: 4249
來自: Taipei,Taiwan

第 2 樓

發表發表於: 星期四 七月 15, 2004 10:18 am    文章主題: 引言回覆

參考看看:
-------------------------------
Knowledge Base

HOWTO: Export an Embedded .bmp Image into a FilePSS ID Number: 161832

Article Last Modified on 12/3/2003


--------------------------------------------------------------------------------
The information in this article applies to:


Microsoft Visual FoxPro for Windows 3.0
Microsoft Visual FoxPro for Windows 3.0b
Microsoft Visual FoxPro for Windows 5.0
Microsoft Visual FoxPro for Windows 6.0
Microsoft FoxPro for Macintosh 2.5b
Microsoft FoxPro for Macintosh 2.5c
Microsoft FoxPro for Macintosh 2.6a
Microsoft Visual FoxPro for Macintosh 3.0b

--------------------------------------------------------------------------------

This article was previously published under Q161832
SUMMARY
The command "APPEND GENERAL <General field name> FROM <filename>.bmp" imports a BMP image from a file and places it into a general field. But there is no reverse command like "Copy General To," which can export an embedded BMP image into a .bmp file. The following steps offer a workaround specially designed for embedded .bmp files only, other data formats can be easily exported if the storage structure of an OLE object is recognizable.
MORE INFORMATION
The following steps and sample program can be used to save an embedded bitmap file to a physical file on disk:


Go to the record number of a table that you would like the associated BMP image exported to.
Copy the general field (Name "Picture") of the record to a temporary file (Name "Temp"). So the newly created Temp.dbf file contains one general field "Picture" and one record only. The syntax for this follows:
COPY TO temp FIELDS picture NEXT 1

Execute the following code, assuming the file name for the output BMP image is "Test.Bmp":
*** Open two files, "temp.fpt" contains the physical BMP data.
*** and Create a file handle for the output file "Test.Bmp"
handlein=FOPEN("temp.fpt")
handleout=FCREATE("test.bmp")

*** To determine the length of the Input file "Temp.fpt"
gnEnd = FSEEK(handlein, 0, 2)
gnTop = FSEEK(handlein, 0)

*** Store the whole file into a string "str1"
str1 = FREAD(handlein, gnEnd)

*** Offset 599 bytes from Str1 and save it to "str2"
str2=RIGHT(str1,LEN(str1)-599)

*** Write "Str2" into the BMP file "Test.BMP"
n=FWRITE(handleout,str2)

*** Close both opened files
=FCLOSE(handlein)
=FCLOSE(handleout)

NOTE: If the BMP is placed into a General field by Edit/Paste from Clipboard, the data stored in general field is 599 bytes of header bytes plus the actual BMP data.

If the .bmp file is embedded in a general field by "Insert Object" or "Append General," then FoxPro creates presentation data plus the actual .bmp file data into the general field, which may result in the size of the FTP file being twice as big as the original .bmp data and if this is the case, 599 may not be the correct offset.
Keywords: kbhowto KB161832
Technology: kbAudDeveloper kbFoxPro250bMac kbFoxPro250cMac kbFoxPro260aMac kbFoxproSearch kbHWMAC kbOSMAC kbVFP300 kbVFP300b kbVFP300bMac kbVFP500 kbVFP600 kbVFP600Search kbVFPsearch



--------------------------------------------------------------------------------

Send feedback to Microsoft

& 2004 Microsoft Corporation. All rights reserved.

_________________
如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問

請聯絡我們,也許我們幫得上忙
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 AIM Address
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
1頁(共1頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作