Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "HBitmap" in [All]

gdi32

.

    IntPtr pOrig = SelectObject(pSource, bmp.GetHbitmap(Color.Black));

.

    IntPtr pOrig = SelectObject(pSource, bmp.GetHbitmap());

.

hSection is a handle to a file mapping object that the function will use to create the DIB and can be NULL. If hSection is not NULL, it must be a handle to a file mapping object created by calling the CreateFileMapping function (otherwise CreateDIBSection will fail). Moreover, the CreateDIBSection function will locate the bitmap’s bit values at offset dwOffset in the file mapping object referred to by hSection. An application can retrieve the hSection handle by calling the GetObject function with the HBITMAP returned by CreateDIBSection.

.

gBrush = CreatePatternBrush(bB.GetHbitmap)

.

IntPtr maskHbitmap = maskImage.GetHbitmap();

.

void PaintLine3(IntPtr hbitmap, Point start, Point end, bool erase)

.

    IntPtr pOrig = SelectObject(pDC, hbitmap);

.

Call DeleteObject on a HBitmap object after using the GDI+ function:

.

public static Bitmap FromHbitmap(

.

    IntPtr hbitmap

.

FromHbitmap transfers a copy of the image bytes into returned Bitmap so it is important to call DeleteObject on the HBitmap to prevent two copies of the image from existing in the system.

.

Had a terrible time getting this to work to retrieve a BITMAP object from a HBITMAP, this code finally worked.

.

GDI32.GetObject(hBitmap, Marshal.SizeOf<GDI32.BITMAP>(), ptrToBitmap);

.

A better option than the above example would be to leverage Image.FromHbitmap

.

Image.FromHbitmap Documentation on MSDN: https://msdn.microsoft.com/en-us/library/k061we7x

.

static extern TODO HBitmap(TODO);

.

Declare Function HBitmap Lib "gdi32.dll" (TODO) As TODO

.
Documentation
[HBitmap] on MSDN
.

IntPtr maskHbitmap = maskImage.GetHbitmap();

.

void PaintLine3(IntPtr hbitmap, Point start, Point end, bool erase)

.

    IntPtr pOrig = SelectObject(pDC, hbitmap);

.

IntPtr maskHbitmap = maskImage.GetHbitmap();

.

void PaintLine3(IntPtr hbitmap, Point start, Point end, bool erase)

.

    IntPtr pOrig = SelectObject(pDC, hbitmap);

.

    public static extern int DeleteObject(int hBitmap);

.

                hbmp = bmp.GetHbitmap();

user32

.

static extern bool CreateCaret(IntPtr hWnd, IntPtr hBitmap, int nWidth,

.

    Public Shared Function CreateCaret(ByVal hWnd As IntPtr, ByVal hBitmap As IntPtr, ByVal nWidth As Integer, ByVal nHeight As Integer) As Boolean

.

    Public Shared Function CreateCaret(ByVal hWnd As IntPtr, ByVal hBitmap As IntPtr, ByVal nWidth As Integer, ByVal nHeight As Integer) As Boolean

.

    Dim bmPtr As IntPtr = GetHBitmap()

.

    The hBitmap parameter is a handle to the bitmap you want to use(or gray/solid).

.

    Function GetHBitmap() As IntPtr

.

    Return bm.GetHbitmap()

.

     IntPtr imgHandle = img.GetHbitmap();

.

     IntPtr imgHandle = img.GetHbitmap();

.

    internal static extern int SetMenuItemBitmaps(HMenu hmenu, int nPosition, MFMENU uflags, IntPtr hBitmapUnchecked, IntPtr hBitmapChecked);

.

     public IntPtr hbmMask;     // (HBITMAP) Specifies the icon bitmask bitmap. If this structure defines a black and white icon,

.

     public IntPtr hbmColor;    // (HBITMAP) Handle to the icon color bitmap. This member can be optional if this

.

        return Image.FromHbitmap(ii.hbmColor);

.

        return Image.FromHbitmap(ii.hbmMask);

.

   uint uFlags, IntPtr hBitmapUnchecked, IntPtr hBitmapChecked);

.

        public static extern int SetMenuItemBitmaps(IntPtr hMenu, IntPtr nPosition, int wFlags, IntPtr hBitmapUnchecked, IntPtr hBitmapChecked);

.

            IntPtr intp = bmp.GetHbitmap();

.

CreateCaret(listBox1.Handle,mybitmap.GetHbitmap(), 1, listBox1.Height);

.

        IntPtr hBitmap = IntPtr.Zero;

.

            hBitmap = bitmap.GetHbitmap(Color.FromArgb(0));

.

            oldBitmap = Win32.SelectObject(memDc, hBitmap);

.

            if (hBitmap != IntPtr.Zero)

.

                Win32.DeleteObject(hBitmap);

gdiplus

.

static extern int GdipCreateBitmapFromHBITMAP(HandleRef hbitmap,

.

Declare Function GdipCreateBitmapFromHBITMAP Lib "gdiplus.dll" (TODO) As TODO

.
Documentation
[GdipCreateBitmapFromHBITMAP] on MSDN

comctl32

.

static extern bool ImageList_AddMasked(IntPtr hImageList, IntPtr hBitmap, int crMask);

.

Private Shared Function ImageList_AddMasked(hImageList As IntPtr, hBitmap As IntPtr, crMask As Integer) As Boolean

.

static extern bool ImageList_AddMasked(IntPtr hImageList, IntPtr hBitmap, int crMask);

Interfaces

.
Summary
Exposes memory-efficient methods for accessing bitmaps. This interface is used as a thin wrapper around HBITMAP objects, allowing those objects to be reference counted and protected from having their underlying data changed.
.

    IntPtr hbitmap = IntPtr.Zero;

.

    ((IShellItemImageFactory)ppsi).GetImage(new SIZE(256, 256), 0x0, out hbitmap);

.

    IntPtr hbitmap = IntPtr.Zero;

.

    ((IShellItemImageFactory)ppsi).GetImage(new SIZE(256, 256), 0x0, out hbitmap);

.

    HRESULT CreateImage(IntPtr /* HBITMAP */ bitmap, UI_Ownership options, [Out(), MarshalAs(UnmanagedType.Interface)] out IUIImage image);

Structures

.

    //     The storage medium is a Graphics Device Interface (GDI) component (HBITMAP).

.

    '     The storage medium is a Graphics Device Interface (GDI) component (HBITMAP).

Enums

.

    Transfer = 0, // IUIImage now owns HBITMAP.

.

    Copy = 1, // IUIImage creates a copy of HBITMAP. Caller still owns HBITMAP.


 
Access PInvoke.net directly from VS: