Re: Create picture in memory and move to a specific hdc

From: Mike D Sutton (EDais_at_mvps.org)
Date: 12/20/04

  • Next message: Alessio Biscucci: "Re: Create picture in memory and move to a specific hdc"
    Date: Mon, 20 Dec 2004 23:59:59 -0000
    
    

    > As object, I need to create a picture into memory and then send
    > to a specific hdc of a third parts control to use as watermark.
    > I can create the image, but I don't know how to send it to the hdc.
    >
    > better could be create an Istdpicture's object and pass to control's
    > watermark property that works only with the LoadImage.

    If you want to create a Bitmap then use the CreateDIBSection() or CreateCompatibleBitmap() API calls (or at a push CreateBitmap() if
    you're creating a monochrome Bitmap.) You can then select this Bitmap into a DC and BitBlt() it to your DC. If on the other hand
    you want to create a StdPicture object from your Bitmap then have a look at the OLEPicture library on my site which wraps an API
    HBITMAP (returned from any of the Create*() calls mentioned above) in an OLE picture object (the same object type returned from
    LoadPicture())
    Hope this helps,

        Mike

     - Microsoft Visual Basic MVP -
    E-Mail: EDais@mvps.org
    WWW: http://EDais.mvps.org/


  • Next message: Alessio Biscucci: "Re: Create picture in memory and move to a specific hdc"

    Relevant Pages

    • Re: Clip capture
      ... "when you say you are "getting a negative number on the hDC" do you ... "If the Autoredraw property of the picture box on the second Form is True ... "And does your code set up the picture box to the size of the blit *and* do ... > the bitmap is smaller than the blit, but with the "extra bitmap area" ...
      (comp.lang.basic.visual.misc)
    • Re: Create picture in memory and move to a specific hdc
      ... I need to create a picture into memory and then send ... > If you want to create a Bitmap then use the CreateDIBSection() or ... > you're creating a monochrome Bitmap.) ... > at the OLEPicture library on my site which wraps an API ...
      (microsoft.public.vb.winapi.graphics)
    • Re: Clip capture
      ... does the picture box on the separate Form ... when you say you are "getting a negative number on the hDC" do you ... up the picture box to the size if the blit *and* do a PictureBox.Cls ... the bitmap is smaller than the blit, but with the "extra bitmap area" ...
      (comp.lang.basic.visual.misc)
    • Confused with CreateDIBSection
      ... PointAPIs with the indexes of my waveform and then used PolyLineTo to draw ... the waveform onto the bitmap. ... I see that CreateDIBSection needs a handle to a DC, ... ' Create temporary DC and select input picture into it ...
      (microsoft.public.vb.winapi.graphics)
    • Re: auf Imagelist mit HDC zugreifen
      ... Beispielklasse gestoßen, die ein Bitmap mit einem HDC ... als Objekt aus einem Picture erzeugt. ...
      (microsoft.public.de.vb)

  • Quantcast