Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible to make this string an image?
Message
 
 
To
15/07/2017 04:46:24
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01652660
Message ID:
01652747
Views:
101
>>Hi everybody,
>>
>>If I got this as a value, what is it and can this be transformed into an image somehow?
>>
>>
>>ÿØÿà
>
>Just use that as .pictureVal property. It's a string containing an image, i.e. what you'd get by filetostr("some.jpg").


I put that content into memo nocptrans. What should I do to get it as picture file now? The text starts with the
OK :<birth_date>01/01/1975 00:00:00</birth_date><Gender>F</Gender><Height>64</Height><height_m>163</height_m><mug_shot>ffd8ffe000104a46494600010101007700770000ffdb004300080606070605080707070909080a0c140d0c0b0b0c1912130f141d1a1f1e1d1a1c1c20242e24549a9fffd9</mug_shot><Weight>151</Weight><weight_m>68</weight_m>
I truncated the actual value to show here, it is much longer. So, I got this, but what am I supposed to do with that value to get it as a picture?

Thanks in advance.


The program I currently use to print the picture is the following (very old program, I tried to modify it). Assuming I got mug_shot as the string shown above, what should I do?
case m.iType = 2   && Memo
    LOCAL lcValue
    lcValue = EVALUATE(ImageSource)
	if !empty(m.lcValue) AND NOT ISNULL(m.lcValue)
*Wait window type("&ImageSource")
		if NOT ',' $ ImageSource AND inlist(type("&ImageSource"), "M","Q","W") and len(&ImageSource)>1
			cOFile = GenOFile(".jpg",.t.)
			copy MEMORY(m.ImageSource) to (m.cOFile)
			cOFile = E0Resize(m.cOFile, dpi)
		ENDIF
		
		IF ',' $ ImageSource
			cOFile = GenOFile(".jpg",.t.)
			STRTOFILE(m.lcValue, cOFile)
*!*         if INLIST(type("&ImageSource"), "Q","W") && blob field
*!*            cOFile = GenOFile(".jpg",.t.)
*!*            strtofile(&ImageSource,m.cOFile)
        	cOFile = E0Resize(m.cOFile, dpi)
     	endif
	endif
My case is currently ',' in ImageSource (as I am now calling decryption function as opposed to just Table.Column)
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform