Get displayed picture as array....

Discussions about document viewing.
Post Reply
sarzan
Posts: 25
Joined: Thu Jul 05, 2007 12:07 pm
Location: Florence - Italy

Get displayed picture as array....

Post by sarzan » Tue Aug 28, 2007 12:52 pm

i need to get the current displayed picture as byte array of a 24bpp bmp image.

Is possible with gdViewer (wich version) ? or if not... is possible with gdPicture (wich version) ?

User avatar
Loïc
Site Admin
Posts: 5592
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Wed Aug 29, 2007 12:35 pm

Hi,

You can get this functionality into the GdPicture Light and into GdPicture PRO OCX:

http://www.gdpicture.com/references/gdp ... Array.html

Ex in vb6:

Code: Select all

dim nBytesRead as long
dim arBytes() as byte
dim oGdPicture as new GdPicturePro.cGdPicture

oGdPicture.SetNativeImage(GdViewer1.GetNativeImage())
oGdPicture.SaveAsByteArray(arBytes(), nBytesRead, "bmp")
...

Best regards,

Loïc Carrère

sarzan
Posts: 25
Joined: Thu Jul 05, 2007 12:07 pm
Location: Florence - Italy

Post by sarzan » Wed Aug 29, 2007 12:52 pm

Ok i already find it.

I also add a:

oGdPicture.ConvertTo24Bpp

before

oGdPicture.SaveAsByteArray

to be sure the array is of a 24bpp BMP image. Right ?

User avatar
Loïc
Site Admin
Posts: 5592
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Wed Aug 29, 2007 1:35 pm

Code: Select all

Right ?
Yes !

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest