image editor

Blitz3D Forums/Blitz3D Programming/image editor

Steven Noyce(Posted 2006) [#1]
I am making a image editor and I am probably going to have a lot of questions about it, so I thought I would start a thread about it.

My first question is, how do you make the window of your blitz application fill the whole screen when it starts? I don't mean fullscrean, I mean a scaled window, like most programs when you open them. I have tried graphics 640,480,0,3, but I still have to click the enlarge button. Is there a way to get the current screan resolution so I can set graphics with that?

I will use .dll's if I have to, but I much prefer using pure blitz3d.


jfk EO-11110(Posted 2006) [#2]
see the code archives, there's an example on how to MAXIMIZE the window.

EDIT - there are several solutions, the latest:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1370

seems to be the most consequent. You need a user32.delcs file in the userlibs folder tho, as mentioned in the thread.


Steven Noyce(Posted 2006) [#3]
Thanks! I will go look!


jfk EO-11110(Posted 2006) [#4]
see my prev post, added a link.


Steven Noyce(Posted 2006) [#5]
Thanks, I just found that right before you posted.
I will probably use that, but just to make sure, is there not a way to do this with pure blitz code?


jfk EO-11110(Posted 2006) [#6]
no. Well it is pure blitz code, it will only use some OS functions, like every other program that is using the windows of windows.

It's true, KuRiX posted a version that needs some fiddling. I added a version to that thread that orks right out of the box after setting up the decls file.

It's easy, simply create a textfile named user32.decls inside the folder "userlibs" (located in your blitz3D installation folder) and paste these linesto it:



.lib "user32.dll"
GetSystemMetrics% (nIndex%) : "GetSystemMetrics"
ShowWindow(hwnd%,nCmdShow%)
GetWindowLong%(hwnd%,gwl%):"GetWindowLongA"
SetWindowLong%(hwnd%,gwl%,val%):"SetWindowLongA"

Now Blitz can use these commands.

here's the example:
Const GWL_STYLE=-16

DeskWidth  = GetSystemMetrics%(0) 
DeskHeight = GetSystemMetrics%(1) 

Graphics DeskWidth, DeskHeight,32,2
SetBuffer BackBuffer()

hwnd=SystemProperty$("AppHWND")
iStyle=GetWindowLong(hwnd,GWL_STYLE)
SetWindowLong(hwnd,GWL_STYLE,iStyle Or $10000)
ShowWindow(hwnd,3)

While KeyDown(1)=0
 Delay 1
Wend


The pro of this method is: it will allow you to toggle between maximized and normal mode using the OS features, like doubleclicking the title bar etc.

However you will need to use the GetSystemMetrics function to retrieve the users desktop size, so why not use some further functions of the same dll too?


Steven Noyce(Posted 2006) [#7]
Thanks a lot! I just barely found the time to look at this and get it working. School is almost out, so I have more time and not as much homework!!!

So, I was wondering, is there a way to set what size it will resize to when you click on the resize button?

Also, in most normal programs, do they use a while loop like that or just use a repeat/forever, and let the user click on the x to exit?