Several basic BlitzMax questions.
BlitzMax Forums/BlitzMax Beginners Area/Several basic BlitzMax questions.
| ||
Hey everyone! I'm working on learning BlitzMax right now, and am actually picking it up fairly quickly. Although I do have a few quick questions. 1 How do I save screenshots since there is no SaveBuffer command like in Blitz3D? 2 Is there a limit on the size of images that you load with LoadImage? I tried to load a 3000X768 image, and just got a black screen and a massive slow down in the frame rate. When I reduced the image in size a few times, I eventually found that 2000 Pixels in Width seems to be the limit of images that I can load. 3 When using commands such as LoadImage, is there any difference between saying Loadimage, and LoadImage:TImage? Thanks! And Merry Christmas :) |
| ||
1. GrabPixmap, SavePixmapPNG/SavePixmapJPG. 2. The limit is with the graphics card. 3. With functions you never need the :Whatever, unless they are custom functions that are being declared for the first time. I'm working on learning BlitzMax right now, and am actually picking it up fairly quickly. Always use SuperStrict. It's a very good habit to start out with. |
| ||
1 How do I save screenshots since there is no SaveBuffer command SavePixmap(). Create a pixmap the same size as the screen (CreatePixmap), use GrabPixmap to copy the screen buffer into the pixmap, then SavePixmap.like in Blitz3D? 2 Is there a limit on the size of images that you load with LoadImage? 2048x2048 would typically be as high as you should ever go - that will use about 16MB of resources. This varies from system to system as its a hardware limitation. Personally I would never go higher than 1024x1024.I tried to load a 3000X768 image, and just got a black screen and a massive slow down in the frame rate. When I reduced the image in size a few times, I eventually found that 2000 Pixels in Width seems to be the limit of images that I can load. 3 When using commands such as LoadImage, is there any difference LoadImage:Timage simply tells you that loadImage returns a TImage object. You should always define a variable as a TImage, then load the image into that.between saying Loadimage, and LoadImage:TImage? There was a time when you could effectively load an image into an Int - I don't know if you still can but if so, you shouldn't. Apparently it played merry hell with garbage collection. |
| ||
There was a time when you could effectively load an image into an Int Indeed. Don't use Strict/SuperStrict and BlitzMax will try to guess what you want to do. Not really advised. As Ked says, put SuperStrict at the top of your source, and you'll find that the compiler will aid you with basic syntax problems you might have. |
| ||
And also you musn't feed it after midnight. :) |
| ||
Thanks for the help everyone! 1 I figured it might have been SavePixMap, I just couldn't figure out how to use it, lol. 2 I was just curious with this question. I know its a bad idea to use 16 MB images, lol! 3 LoadImage:Timage simply tells you that loadImage returns a TImage object. You should always define a variable as a TImage, then load the image into that. There was a time when you could effectively load an image into an Int - I don't know if you still can but if so, you shouldn't. Apparently it played merry hell with garbage collection. Ok, I'll fix that :) Currently I'm just using LoadImage. put SuperStrict at the top of your source, SuperStrict sounds useful. That will probably help me out a lot for now. And also you musn't feed it after midnight. :) Ty for the advice Amon. I'll only feed it in the morning from now on! Kind Regards, |