Results 1 to 4 of 4

Thread: Getting a Hdc directly from LoadPicture or LoadResPicture

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    10
    Is there a way to get the Hdc directory from LoadResPicture? Can i cast it, or use it directly as a Hdc? or is there a way to get a Hdc from a image out of a resource file?

    If not what it the best way to do it without the loading process being seen?

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    If you want to use LoadPicture check out my tutorial (direct link). I dont know about LoadResPicture, but if it loads a iPictureDisp you can use it instead.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    10
    Thanks, but found a better way:

    Code:
    Dim X as New StdPicture
    set X = LoadPicture("C:\Windows\circles.bmp")
    
    BitBlt X.Hdc, 0, 0, 32, 32, Tile, ActFrame * 32, 0, vbSrcCopy
    You can also create an array of StdPicture to store graphics in Memory until you need them.

  4. #4
    Addicted Member
    Join Date
    Apr 2000
    Location
    England
    Posts
    246
    sorry, change that last line to:

    Code:
    X.Render(Destination:=Picture1.hdc ,xDest:= 0, yDest:= 0, Destwidth:=32, Destheight:=32, xSource:=0, ySource:=0, SourceWidth:=32, SourceHeight:=32, NULL)
    It doesn't allow raster operations thou, I might end up uing some of your code

    Thanks


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