Re: Bitmaps anzeigen?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Windows GDI

SetDIBitsToDevice
The SetDIBitsToDevice function sets the pixels in the specified
rectangle on the device that is associated with the destination device
context using color data from a DIB.

Windows 98/Me, Windows 2000/XP: SetDIBitsToDevice has been extended to
allow a JPEG or PNG image to be passed as the source image.

int SetDIBitsToDevice(
HDC hdc, // handle to DC
int XDest, // x-coord of destination upper-left corner
int YDest, // y-coord of destination upper-left corner
DWORD dwWidth, // source rectangle width
DWORD dwHeight, // source rectangle height
int XSrc, // x-coord of source lower-left corner
int YSrc, // y-coord of source lower-left corner
UINT uStartScan, // first scan line in array
UINT cScanLines, // number of scan lines
CONST VOID *lpvBits, // array of DIB bits
CONST BITMAPINFO *lpbmi, // bitmap information
UINT fuColorUse // RGB or palette indexes
);Parameters
hdc
[in] Handle to the device context.
XDest
[in] Specifies the x-coordinate, in logical units, of the upper-left
corner of the destination rectangle.
YDest
[in] Specifies the y-coordinate, in logical units, of the upper-left
corner of the destination rectangle.
dwWidth
[in] Specifies the width, in logical units, of the DIB.
dwHeight
[in] Specifies the height, in logical units, of the DIB.
XSrc
[in] Specifies the x-coordinate, in logical units, of the lower-left
corner of the DIB.
YSrc
[in] Specifies the y-coordinate, in logical units, of the lower-left
corner of the DIB.
uStartScan
[in] Specifies the starting scan line in the DIB.
cScanLines
[in] Specifies the number of DIB scan lines contained in the array
pointed to by the lpvBits parameter.
lpvBits
[in] Pointer to DIB color data stored as an array of bytes. For more
information, see the following Remarks section.
lpbmi
[in] Pointer to a BITMAPINFO structure that contains information about
the DIB.
fuColorUse
[in] Specifies whether the bmiColors member of the BITMAPINFO
structure contains explicit red, green, blue (RGB) values or indexes
into a palette. For more information, see the following Remarks section.
The fuColorUse parameter must be one of the following values. Value
Meaning
DIB_PAL_COLORS The color table consists of an array of 16-bit
indexes into the currently selected logical palette.
DIB_RGB_COLORS The color table contains literal RGB values.



Return Values
If the function succeeds, the return value is the number of scan lines
set.

If the function fails, the return value is zero.

Windows NT/2000/XP: To get extended error information, call
GetLastError.

Windows 98/Me, Windows 2000/XP: If the driver cannot support the JPEG or
PNG file image passed to SetDIBitsToDevice, the function will fail and
return GDI_ERROR. If failure does occur, the application must fall back
on its own JPEG or PNG support to decompress the image into a bitmap,
and then pass the bitmap to SetDIBitsToDevice.

Remarks
Optimal bitmap drawing speed is obtained when the bitmap bits are
indexes into the system palette.

Applications can retrieve the system palette colors and indexes by
calling the GetSystemPaletteEntries function. After the colors and
indexes are retrieved, the application can create the DIB. For more
information about the system palette, see Colors.

The origin of a bottom-up DIB is the lower-left corner of the bitmap;
the origin of a top-down DIB is the upper-left corner.

To reduce the amount of memory required to set bits from a large DIB on
a device surface, an application can band the output by repeatedly
calling SetDIBitsToDevice, placing a different portion of the bitmap
into the lpvBits array each time. The values of the uStartScan and
cScanLines parameters identify the portion of the bitmap contained in
the lpvBits array.

The SetDIBitsToDevice function returns an error if it is called by a
process that is running in the background while a full-screen MS-DOS
session runs in the foreground.

Windows 98/Me, Windows 2000/XP:

a.. If the biCompression member of BITMAPINFOHEADER is BI_JPEG or
BI_PNG, lpvBits points to a buffer containing a JPEG or PNG image. The
biSizeImage member of specifies the size of the buffer. The fuColorUse
parameter must be set to DIB_RGB_COLORS.
b.. To ensure proper metafile spooling while printing, applications
must call the CHECKJPEGFORMAT or CHECKPNGFORMAT escape to verify that
the printer recognizes the JPEG or PNG image, respectively, before
calling SetDIBitsToDevice.
ICM: Color management is performed. The color profile of the current
device context is used as the source color space profile. The sRGB color
space is used.

Example Code
For an example, see Testing a Printer for JPEG or PNG Support.

Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.

See Also
Bitmaps Overview, Bitmap Functions, BITMAPINFO, GetSystemPaletteEntries,
SetDIBits, StretchDIBits


--------------------------------------------------------------------------------

© 2005 Microsoft Corporation. All rights reserved.

Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.

See Also
Bitmaps Overview, Bitmap Functions, BITMAPINFO, GetSystemPaletteEntries,
SetDIBits, StretchDIBits


--------------------------------------------------------------------------------

© 2005 Microsoft Corporation. All rights reserved.


begin 666 Requirements.gif
M1TE&.#=A%0`5`/<``````( ```" `(" ````@( `@ " @,# P,#<P*;*\ ``
M````*@``50``?P``J@``U `J```J*@`J50`J?P`JJ@`JU !5``!5*@!550!5
M?P!5J@!5U !_``!_*@!_50!_?P!_J@!_U "J``"J*@"J50"J?P"JJ@"JU #4
M``#4*@#450#4?P#4J@#4U"H``"H`*BH`52H`?RH`JBH`U"HJ`"HJ*BHJ52HJ
M?RHJJBHJU"I5`"I5*BI552I5?RI5JBI5U"I_`"I_*BI_52I_?RI_JBI_U"JJ
M`"JJ*BJJ52JJ?RJJJBJJU"K4`"K4*BK452K4?RK4JBK4U%4``%4`*E4`554`
M?U4`JE4`U%4J`%4J*E4J554J?U4JJE4JU%55`%55*E555555?U55JE55U%5_
M`%5_*E5_555_?U5_JE5_U%6J`%6J*E6J556J?U6JJE6JU%74`%74*E745574
M?U74JE74U'\``'\`*G\`57\`?W\`JG\`U'\J`'\J*G\J57\J?W\JJG\JU']5
M`']5*G]557]5?W]5JG]5U']_`']_*G]_57]_?W]_JG]_U'^J`'^J*G^J57^J
M?W^JJG^JU'_4`'_4*G_457_4?W_4JG_4U*H``*H`*JH`5:H`?ZH`JJH`U*HJ
M`*HJ*JHJ5:HJ?ZHJJJHJU*I5`*I5*JI55:I5?ZI5JJI5U*I_`*I_*JI_5:I_
M?ZI_JJI_U*JJ`*JJ*JJJ5:JJ?ZJJJJJJU*K4`*K4*JK45:K4?ZK4JJK4U-0`
M`-0`*M0`5=0`?]0`JM0`U-0J`-0J*M0J5=0J?]0JJM0JU-15`-15*M155=15
M?]15JM15U-1_`-1_*M1_5=1_?]1_JM1_U-2J`-2J*M2J5=2J?]2JJM2JU-34
M`-34*M345=34?]34JM34U ````P,#!D9&28F)C,S,S\_/TQ,3%E9669F9G)R
M<G]_?XR,C)F9F:6EI;*RLK^_O\S,S-C8V.7EY?+R\O_[\*"@I(" @/\```#_
M`/__````__\`_P#______RP`````%0`5```(D@##W1I(L*#!@N'",1+#L*'#
MAPP9)61TL&)!B0IO_=O(L:/'6Q@I>AS9$>1$C20Y)EB9P&3&E!L3%"F"8V!(
ME"EGXJ#H4F3,(DL2_-RIL2=.F4'_R22ZT:A*H"MI^OSG]&=0J3BIWE3Y8PG6
ICULYWOK!%.S)DF7-ON3(:*I:MS";AHTK]J9%BR$AZG6(\:[?< $!`#L`
`
end

.



Relevant Pages

  • Re: Signature control - 1 BPP bitmap
    ... So I tried BitBlt to a bitmap and then to a 1 ... Maybe Blt-ing to the DIBSection is still doing ... There's the DIB behavior ... >> Windows CE Multimedia and Graphics ...
    (microsoft.public.pocketpc.developer)
  • Re: Brush that paints a texture?
    ... Do you mean that if I use a DDB instead of a ... >DIB, I will get noticably better performance with I BitBlt? ... display format, either by Windows, the driver, or the video card. ... > What do you mean by ugly desktop painting? ...
    (microsoft.public.win32.programmer.ui)
  • Re: Transparent Blit with NT4
    ... > Mike D Sutton wrote: ... > Pretty sure I'm not - I have tested it on Windows ME, works fine, and ... >> Also, how are you creating the bitmap you're drawing from, and what ... > REM and direct drawing for the rest ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Saving and loading bmp using graphics object
    ... Windows needs to know that part of your window needs redrawing. ... that this bitmap is a copy of what you want to appear on screen. ... > private void DrawPoint ... > private void Scribbler_MouseMove(object sender,> System.Windows.Forms.MouseEventArgs e) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Why is Screen Sharing app hidden away?
    ... button, add this bitmap" just the same as Windows does locally, or X ... VNC is an after-the-fact "copy this bitmap over the ... should be able to hook in at that layer and send those instructions ... Is it a tarted up VNC or does it do the same as Windows ...
    (uk.comp.sys.mac)