A Few Questions: ClipCursor(), SetPalette, possibly pointers, looking for Great Graphics Program 
Author Message
 A Few Questions: ClipCursor(), SetPalette, possibly pointers, looking for Great Graphics Program

        I have a few questions to ask the programmer's on this corner of the Net.
If answering my questions, remember that I have little money to spend, and
will usually take a shareware version over any other solutions

        I would like to confine the cursor into a rectangle. I've found that the
API function "ClipCursor", in the user library, is specifically designed to
do this. However, I can't use this function in my Visual Basic program
because it requires pointers, something that I know about from my C
Programming, but cannot use because (as far as I know) VB doesn't  use
them. Is there some way I can make my own API functions? Is there a way of
using pointers in VB? Or maybe there's another function that will do the
same thing?

        I also need to set the system palette to the colors that I need for my
programs. I know SetPalette() will do this, but I can't use it for the same
reasons as above.

        I also need a Graphics program that will allow me to "tilt" an image. I
need to "turn" it, 10 degrees, 20 degrees, maybe 5 degrees.

        Thank You for your support.



Wed, 24 May 2000 03:00:00 GMT  
 A Few Questions: ClipCursor(), SetPalette, possibly pointers, looking for Great Graphics Program

Quote:

>         I would like to confine the cursor into a rectangle. I've found that the
> API function "ClipCursor", in the user library, is specifically designed to
> do this. However, I can't use this function in my Visual Basic program
> because it requires pointers, something that I know about from my C
> Programming, but cannot use because (as far as I know) VB doesn't  use
> them.

VB does use pointers, it just hides them from the programmer.  If I
declare a function like:

  Declare Sub ClipCursor Lib "User" (lpRect As Any)

and then call the function like this:

  Dim R as RECT
  R.Left = 0
  R.Top = 0
  R.Right = 100
  R.Bottom = 100
  ClipCursor R

VB actually passes R's address (a pointer to R) to the ClipCursor
routine.  VB's strings are handled differently.  I can also call
ClipCursor like this:

  Dim R as String * 8
  R$ = Chr$(0) & Chr$(0) & Chr$(0) & Chr$(0) & Chr$(100) & Chr$(0) &
Chr$(100) & Chr$(0)
  ClicpCursor ByVal R$

When passing strings, VB normally passes the string handle.  Since we
want to pass a pointer to the string data, we must include the BYVAL
keyword.  This is counterintuitive, but this is the way to pass a
pointer to a string in VB.

Note also that I can pass the rectangle data to ClipCursor in either of
these ways because I declared the parameter to ClipCursor as "Any."
This tells VB not to perform type checking and to simply pass the
included data.

HTH,

chris judge

Quote:
>         I also need a Graphics program that will allow me to "tilt" an image. I
> need to "turn" it, 10 degrees, 20 degrees, maybe 5 degrees.

>         Thank You for your support.



Fri, 26 May 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Beginner in VB looking for answers to a few quick questions

2. GREAT QUESTION NEED GREAT HELP

3. A few pointers please.

4. A few pointers needed: Working with the Registry (VB5, NT/95)

5. Newbie question - possibly irritating

6. Possibly off-topic VBSCRIPT question.

7. quite possibly a silly question...

8. Possibly a stupid question about winsock control

9. looking for a few good Apps

10. Looking for a few good men

11. Look for a few good developers...

12. Always looking for a few good VB programmers

 

 
Powered by phpBB® Forum Software