Barry's post made me think about what my minimum graphic needs have been in the last few years.
Mostly, I've just read JPG/BMP/GIF files, done something minor with them (display, rotate, shrink, expand, ..), then write the changed image back out to a file format of my choice.
With PowerBASIC I was surprised to find no built-in read/write features except for BMP formats.
I figured that most programmers had at least my own basic image handling needs and that there were probably a few well-known API to do the trick, else PowerBASIC users would have revolted.
The GRAPHIC statements seem completely adequate for my modest image manipulation needs. It's getting the image formats in and out where a non-PowerBASIC solution seems to be required.
Despite the zillion graphic examples in the forums, I've been unsuccessful in pulling out what I thought should be simple code for:
1. Reading a JPG/GIF/PNG file and getting a handle to a memory bitmap that I could use in PowerBASIC GRAPHIC statements.
2. Write an existing GRAPHIC memory bitmap to JPG/GIF/PNG files.
I think the problem is that I was expecting simplicity - a handful of lines of code. But what I'm finding is that I'm having to filter through far more lines of code that I expected. The "found a solution in 10 minutes" hasn't happened for me.
So, off I go to look in more detail, learn more that I thought I'd have to. I will, of course, be the better for it - and it's a topic that I'm interested in. I'll post whatever I find/come up with that seems to meet my minimal needs.
But have I missed some simple (probably GDI ?) code example that everyone else must already know about - except me?
P.S. - I've seen 3rd party libraries, such as freeimage discussed, but like one of Jose's comments, it seems a shame not to use the built-in Windows API unless there's a fundamental issue. In my case, where I have very modest needs, it seems like a GDI solution would be sufficient and that 3rd party DLLs would be an unnecessary burden.
Mostly, I've just read JPG/BMP/GIF files, done something minor with them (display, rotate, shrink, expand, ..), then write the changed image back out to a file format of my choice.
With PowerBASIC I was surprised to find no built-in read/write features except for BMP formats.
I figured that most programmers had at least my own basic image handling needs and that there were probably a few well-known API to do the trick, else PowerBASIC users would have revolted.
The GRAPHIC statements seem completely adequate for my modest image manipulation needs. It's getting the image formats in and out where a non-PowerBASIC solution seems to be required.
Despite the zillion graphic examples in the forums, I've been unsuccessful in pulling out what I thought should be simple code for:
1. Reading a JPG/GIF/PNG file and getting a handle to a memory bitmap that I could use in PowerBASIC GRAPHIC statements.
2. Write an existing GRAPHIC memory bitmap to JPG/GIF/PNG files.
I think the problem is that I was expecting simplicity - a handful of lines of code. But what I'm finding is that I'm having to filter through far more lines of code that I expected. The "found a solution in 10 minutes" hasn't happened for me.
So, off I go to look in more detail, learn more that I thought I'd have to. I will, of course, be the better for it - and it's a topic that I'm interested in. I'll post whatever I find/come up with that seems to meet my minimal needs.
But have I missed some simple (probably GDI ?) code example that everyone else must already know about - except me?
P.S. - I've seen 3rd party libraries, such as freeimage discussed, but like one of Jose's comments, it seems a shame not to use the built-in Windows API unless there's a fundamental issue. In my case, where I have very modest needs, it seems like a GDI solution would be sufficient and that 3rd party DLLs would be an unnecessary burden.
Comment