StretchDIBits format questions

Win32 Programming


  • 1. SetDPI
    How do I fixed SetDPI to 96 in my MFC Application? Regards Manoj Jangid
  • 2. How to clear clipboard
    I'm wondering how to clear the clipboard not via API under WindowsXP? TIA William
  • 3. GDI Plus Q.
    I'm using C# but I think to solve the problem I need to ask someone who's used GDI plus directly. If I create a bitmap from a stream or a file gdip always seams to keep a reference to the original source and won't release it unless I make a copy of the bitmap and dispose the original. Only then can I dispose of the stream or delete the file if need be. I've had a look at the c# code using reflector and it appears c# isn't keeping the reference so I presume gdi plus is. Is there any way to release this without creating a copy of the bitmap? Many thanks in advance. Michael
  • 4. deinterlacing a bitmap
    I have I gdiplus bitmap which is 576 in height, and I need to split it into 2 bitmaps 288 in height, with alternate rows in each. The way I am currently doing it is as follows ( where in_pGdiBitmap is bitmap to split, and m_pOGDIGraphicsEven / m_pOGDIGraphicsOdd are the resulting two bitmaps ) This does work, but I need to do it supper efficiently... has anyone got any ideas RectF destRect( 0f, 0f, 720f, 288f ); if(m_pOGDIGraphicsEven) { m_pOGDIGraphicsEven->DrawImage( in_pGdiBitmap, destRect, 0f, 0f, 720f, 576f, UnitPixel ); } if(m_pOGDIGraphicsOdd) { m_pOGDIGraphicsOdd->DrawImage( in_pGdiBitmap, destRect, 0f, 1f, 720f, 576f, UnitPixel ); } thanks in advance aidanh

StretchDIBits format questions

Postby RGF2aWQgVGhpZWxlbg » Sat, 29 Oct 2005 00:18:20 GMT


The documentation in 
for StretchDIBits is a link to 
 http://www.**--****.com/ :

rop //dword
usage //word
srcHeight //word
srcWidth //word
ySrc //word
xSrc //word
destHeight //word
destWidth //word
yDest //word
xDest //word
bitmap //byte[]

Where is this documented?

thanks - dave

Re: StretchDIBits format questions

Postby Vipin[MVP] » Sat, 29 Oct 2005 07:29:50 GMT

Assuming from context of your posts, you are looking for this probably

typedef struct tagEMRSTRETCHDIBITS {
  EMR   emr;
  RECTL rclBounds;
  LONG  xDest;
  LONG  yDest;
  LONG  xSrc;
  LONG  ySrc;
  LONG  cxSrc;
  LONG  cySrc;
  DWORD offBmiSrc;
  DWORD cbBmiSrc;
  DWORD offBitsSrc;
  DWORD cbBitsSrc;
  DWORD iUsageSrc;
  DWORD dwRop;
  LONG  cxDest;
  LONG  cyDest;
Vipin Aravind
MVP [Windows - Printing/Imaging]

Re: StretchDIBits format questions

Postby RGF2aWQgVGhpZWxlbg » Sat, 29 Oct 2005 07:45:04 GMT


Sorry - no, this question was for a regular meta-file, not an enhanced 
metafile. I have to handle both because the Word Equation editor saves as a 
regular metafile while the Word Picture object saves as enhanced.

thanks - dave

Re: StretchDIBits format questions

Postby v-raygon » Sat, 29 Oct 2005 17:10:10 GMT

Hello Dave,
From your description, you need to use both regular metafile (windows format metafile?) and enhanced metafile in your application. GetWinMetaFileBits can be used to 
convert the enhanced-format records from a metafile into Windows-format records, I suggest you take a loot at it: 

I am not very sure what metafile structure you are looking, but fortunately, here is a complete list on all supported metafile structure, could you check if it is there?
Metafile Structures

Rhett Gong [MSFT]
Microsoft Online Partner Support
Get Secure! -

This posting is provided "AS IS" with no warranties and confers no rights.

Return to Win32 Programming


Who is online

Users browsing this forum: No registered users and 2 guest