Results 1 to 4 of 4

Thread: [resolved] Help: StretchBlt results in empty .Picture property

Threaded View

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jul 2002
    Posts
    8

    [resolved] Help: StretchBlt results in empty .Picture property

    VB Code:
    1. Private Sub Command2_Click()
    2.  
    3.  z = 2
    4.  pic2.Height = pic1.Height / z
    5.  pic2.Width = pic1.Width / z
    6.  
    7.  
    8. For x = 0 To pic2.Width
    9.  For y = 0 To pic2.Height
    10.  
    11.  StretchBlt pic2.hdc, x, y, z, z, pic1.hdc, x * z, y * z, z, z, &HCC0020
    12.  
    13.  Next y
    14. Next x
    15.  
    16.  pic2.Refresh
    17.  Clipboard.SetData pic2.Picture
    18.  
    19. End Sub

    What the code above does is first resize the picturebox pic2 to be half the size of pic1, then copy the picture from pic1 to pic2 at half size. I use the for next loop rather than one StretchBlt because it yields better looking results.

    My problem is when I want to copy the resulting picture to the clipboard pic2.Picture = 0. I don't think I full understand what StretchBlt is doing with the picture and/or video memory. Is there a way I can copy the result in pic2 to the clipboard.

    any suggestions?

    thanks
    Last edited by BeerBaron; Jul 7th, 2002 at 09:16 PM.

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