PC SOFT
ONLINE REPOSITORY
FOR WINDEVWEBDEV AND WINDEV MOBILE

Home |  | Sign in | English US
Reading image from Stream
Published by Patrice TERRIER
in the category Tools
New features



Description
This project shows you how to read an image stored in a Stream buffer, and display it Inside of a GDImage graphic control.

Here is the code to load a Stream from the application's "EXE\images" subfolder.

PROCEDURE GDImageGetStreamFromFile(LOCAL sFileStream is string)
IF (IsWindow(gP.hCtrl)) THEN
IF (fFileExist(sFileStream)) THEN
nBufferSize is unsigned int = fSize(sFileStream)
fHandle is int = fOpen(sFileStream, foRead)
IF (fHandle <> -1) THEN
buffer is array dynamic of nBufferSize 1-byte int
fRead(fHandle, nBufferSize, &buffer)
fClose(fHandle); fHandle = 0
IF (NOT ZI_LoadImageFromStream(gP.hCtrl, &buffer, nBufferSize)) THEN
Trace("Error")
END
END
END
END

Note: The software perform an automatic format detection, and in case of success, the image is shown directly inside of the GDImage graphic control.

...
Illustrations, screen shots
none
none
User reviews
(To evaluate this resource, click 'Write a review')
No review or comment? Be the first one!
ABOUT
RATING:
00No rating
DOWNLOADS:
224
PUBLISHED:
November 16, 2016
VERSION:
CONCERNS:
WINDEV
Minimum version: WD17
SIZE:
474.2 KB
OF SAME DEVELOPER