Results 1 to 3 of 3

Thread: *RESOLVED* casting?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    *RESOLVED* casting?

    I saw this somewhere:
    Dim clipRegion As New [Region](clipRect)

    does this mean that it is casting the clipRect to Region type and giving its value to clipRegion?
    Last edited by MrPolite; Oct 1st, 2002 at 03:25 PM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Actually I think ()in the front of an object is casting in C# but this looks like VB.NET code so it is just saying that the type is Region instead of using the Region keyword.

    You have to do the samething with Assembly:

    VB Code:
    1. 'i forgot the imports but if you dim the following
    2. 'it'll error because it thinks that you are using
    3. 'Assembly as a keyword instead of the Type
    4. dim asm as Assembly 'this does not work
    5.  
    6. 'so you have to enclose it in [] to show it what you mean
    7. 'like you do for Enums in both VB6 and .NET
    8.  
    9. dim asm as [Assembly] 'this works

    Region can be used to make collapsable Regions of code in the IDE so you have to [] around it to let it know you mean the Type Region instead.

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width