Windows has no Standard control for displaying jpegs and Gifs, but there is a
way to put it into a control (it's not documented very well). The Listview
control has the ability to display various image formats in it's background, so
you can use the listview as a image control. Here is some code on how it's
done:
\ background image structure
class LVBKIMAGE
variable flags
variable bmp
variable image
variable count
variable xoff
variable yoff
end-class
lvbkimage builds x
\ Necessary Initialization
0 coinitialize drop
: Set-Image ( hwnd zstr -- ) \ handel of listview control and filename
2 x flags ! x image !
LVM_FIRST 68 + 0 x addr SendMessage drop ;
This will do the job, but it does have a drawback. The string is actually a
url, so you need to specify the entire path and file name to make it work.
This may not help you much with your application, but it's an interesting
windows tidbit...
Quoting Azedia of DOLFINA <dolfina_at_dolfina.org>:
> Revisiting graphics solutions: I cannot recall asking about displaying JPEGs.
> I did search for them on SF website.
> It seems that there is not any solutions except using a third-party dll. Is
> that correct? I need to display approx. 50
> jpegs total for my screensaver project. I am sure if that will be too large a
> file. SF is between 441 K or more when
> turnkeyed I think. Then there are the jpegs which I have not gotten the most
> recent smallest viewable file size from
> our one 1/2 person art department. -) But I think it is about 100K more or
> less. So, that is times say 50, totalling
> 5,000 at least. So, that seems to bring the .scr/.exe file to at least 5,000
> k. This seems to be huge for a screensaver.
>
> I have a few questions. How can I reduce this file size to near 500-1,000 K?
> Can I place the JPEGS in a folder that
> calls them from the .scr? If I did that either I or the end user could add
> JPEGs.
>
> If I used Fastgraph would I have to include DLLs in the distribution?
>
> Jodell
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
> For help with listar commands, send subject "help" to listar_at_forth.com
> Archives are located at http://www.forth.com/sftalk -- check them out!
> Search the archives! Visit http://www.forth.com/search for details.
>
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Fri Aug 16 2002 - 19:13:52 PDT
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 06-Feb-2012. Archive updated nightly.