Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15737

VB6: how get the pixels array from a HDC?

$
0
0
using the GetObject(), i can get the HBITMAP... but i need more.... for create the pixel array from a HDC.
using the GetObject(), can i get the HDC actual hDib and the lBits?
maybe i need combine the GetObject(), for get the HBitmap, with GetDIBits() for get the lpBits...
Code:

Public Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long

Public Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long

but i'm confused:
1 - how can i get the actual HBitmap using the GetObject()? hObject must be the HDC? i need some corrections
2 - on GetDIBits () we have nStartScan and nNumScans, my question what values i can use?

i need draw pixel by pixel directly to a HDC.... do change\calculate the pixels and then draw it directly to HDC... these can cause several flickers, unless the HDC is memory and then draw it on screen\form\control.. but i need for test now... then i can create a memory HDC for the entire result and then draw it on screen ;)

Viewing all articles
Browse latest Browse all 15737

Trending Articles