Results 1 to 40 of 110

Thread: [VB6] GDI+ Usage & Samples

Threaded View

  1. #18
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: [VB6] GDI+ Usage & Samples

    Quote Originally Posted by LaVolpe View Post
    Jonney, nope. Notice that clrMatrix(4, 4) is set to non-null when grayscale matrix was created. The lightness matrix section is only filling in those matrix items if clrMatrix(4, 4) is null. That should be the case for all the matrix sections. Only fill in the required items if they haven't already been filled in.

    My alpha image control rewrote that logic, but fundamentally, it uses the same checks & balances.
    I miss the check.

    I am troubleshooting why the alpha doesn't work: hGraphics bind to hImage.
    Code:
    GdipGetImageGraphicsContext hImage, hGraphics 
    imgAttributesHandle = pvModifyAttributes(Alpha,Lightness, TransColor,GrayScale)
    GdipDrawImageRectRectI hGraphics, hImage, 0, 0, imgWidth, imgHeight, 0, 0, imgWidth, imgHeight, UnitPixel, imgAttributesHandle
    If imgAttributesHandle Then GdipDisposeImageAttributes imgAttributesHandle
    GdipDeleteGraphics hGraphics
    Edited:
    But this one is OK: hGraphics created by hdc.
    Code:
    Public Sub gdipStretchPicture(ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, hImage As Long, ByVal srcX As Long, ByVal srcY As Long, ByVal srcWidth As Long, ByVal srcHeight As Long, Optional ByVal srcUnit As GpUnit = UnitPixel)
       
       If hImage <> 0 Then
          Dim hGraphics As Long
          GdipCreateFromHDC hdc, hGraphics
          Dim Attributes As Long                              'Testing Code
          Attributes = pvModifyAttributes(70, 0, 0, 1)  'Testing Code
          GdipDrawImageRectRectI hGraphics, hImage, x, y, Width, Height, srcX, srcY, srcWidth, srcHeight, srcUnit, Attributes
          If Attributes <> 0 Then GdipDisposeImageAttributes Attributes
          GdipReleaseDC hGraphics, hdc
          GdipDeleteGraphics hGraphics
       End If
       
    End Sub
    Last edited by Jonney; Aug 29th, 2015 at 04:33 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