[Implemented] SaveImage()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] SaveImage()

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

It would be nice to have a SaveImage command

Result = SaveImage(#Image, FileName$)

so we can easily load an image, draw on it and then save back to disk.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Planned.. I hope for the next release. But BMP writting code shouldn't be so hard to adapt in PB :wink:. LoadImage() and CreateImage() returns the Windows Bitmap pointer (HBMP).

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Done. Updated lib can be found on http://www.purebasic.com/update/Image

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Excellent job Fred !!

I was having a heck of a time drudging through the dreaded Windows API trying to make heads or tails of the whole Bitmap process.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Hey Fred,

I have a BMP that is 900kb (640x480)
When I save it to disk using SaveImage() the resulting file is 1200kb and is unreadable by PhotoShop. MS Paintbrush will read it but what's with the extra 300kb ?? (is it trying to save Alpha info?)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Unreadable with photoshop ? Damn. In fact, it saves in the same format than your screen mode (I guess you work in 32 bit). It's a bit silly and I will try to change it quickly. Thanks for the info..

Fred - AlphaSND
Post Reply