Results 1 to 5 of 5

Thread: DX7 surfaces again :)

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    NJ
    Posts
    10

    Talking

    When I am trying to create a surface with width more that 640 pixels, my program crashes. The height, however, does not crash my app even at 1024 pixels. The screen resolution is 640x480 pixels. Is there a limitation on how wide a surface could be? What can I do if I need to create, let's say, 800x600 surface?

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Make sure you set it to be an OFFSCREEN PLAIN! :P
    Heehehe! I am insane!

    Sorry, I just got a sugar rush...

    Yeah, thats probably it or there's a limitation, in which case you would want to divide the pic up, or make a picbox and grab the hDC to make a surface
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3
    Addicted Member drewski's Avatar
    Join Date
    Feb 2000
    Location
    WA
    Posts
    242
    post some code so we can see it. you should be able to create surfaces that are much larger than 640x480. i do this in the map editor for my rpg. i have surfaces that are up to 4800x4800. somethings probably wrong with the code so post it here.


    Drewski
    Last edited by drewski; Mar 5th, 2001 at 09:02 PM.
    I see said the blind man as he spat into the wind.

    It all comes back to me now!

    A.D.T.'s VB

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    NJ
    Posts
    10

    Post

    Here's the code that I use to create a surface from a file:

    Public Sub LoadSurface(srfSurface As DirectDrawSurface7, strFileName As String, lWidth As Long, lHeight As Long)
    On Local Error Resume Next

    Dim ddGeneric As DDSURFACEDESC2

    With ddGeneric
    .lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH
    .ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
    .lWidth = lWidth ' <-- "invalid procedure call or argument", when 'lWidth is larger than 640
    .lHeight = lHeight
    End With

    Set srfSurface = dd.CreateSurfaceFromFile(strFileName, ddGeneric)

    If Err Then: Call EndIt
    End Sub

  5. #5
    Addicted Member drewski's Avatar
    Join Date
    Feb 2000
    Location
    WA
    Posts
    242
    hey i think i might know your problem. make sure when you are setting the height and width of the surface that neither of them are equal to zero. this has happened to me before and it makes sense to have the height and width more than zero or else you wouldnt really have a surface.

    if this doesnt fix your problem then i'm stumped. you could try asking Fox, Kedaman, or maybe Young Buck. these people seem to know what they are doing in this area. theres a few others out there just i cant recall their names.
    Last edited by drewski; Mar 7th, 2001 at 01:12 AM.
    I see said the blind man as he spat into the wind.

    It all comes back to me now!

    A.D.T.'s VB

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