RECT Type
-
- Posts: 38
- Joined: Jun 30, 2005 4:44
RECT Type
Im making a small little sprite library and Im using GetClientRect to get the client area of the window so I can stretch the background image to fit to it and I cant figure out what the RECT.x1's and RECT.y1's and such, Ive tried a lot of stuffs and cant figure it out =-\.
Last edited by Kcproductionz on Jul 26, 2005 16:58, edited 2 times in total.
Look in winbase.bi:
Code: Select all
Type RECT
nLeft As Integer
nTop As Integer
nRight As Integer
nBottom As Integer
End Type
-
- Posts: 38
- Joined: Jun 30, 2005 4:44
Not sure what you mean by "compiled"; here's an example of using a RECT:
Code: Select all
#include "win/winbase.bi"
Dim my_rect as RECT
my_rect.nLeft = 5
my_rect.nTop = 10
my_rect.nRight = 20
my_rect.nBottom = 30
All structures are defined in the "headers" of the library. For FreeBASIC, these are the .bi files in \inc, or for the Windows API, \inc\win. Otherwise, your program couldn't use them. To the libraries, structures in memory are just a bunch of bytes: "RECT", and it's properties are nowhere to be found in the DLL files.
You don't need to worry about including winbase.bi (the other headers, such as kernel32.bi take care of this). But that's how the win-api headers defines one. Just check the header files if you need to know what's in any other structures.
You don't need to worry about including winbase.bi (the other headers, such as kernel32.bi take care of this). But that's how the win-api headers defines one. Just check the header files if you need to know what's in any other structures.
@Kcproductionz
Windows help file states that RECT is defined as:
but in freebasic's winbase.bi it's declared as:
So if something doesn't work as aspected, you have to look into the *.bi files and write your code as it's declared in the *.bi include files.
Windows help file states that RECT is defined as:
Code: Select all
Type RECT
Left As Integer
Top As Integer
Right As Integer
Bottom As Integer
End Type
Code: Select all
Type RECT
nLeft As Integer
nTop As Integer
nRight As Integer
nBottom As Integer
End Type