% %
% %
% %
+% CCCC L IIIII PPPP BBBB OOO AAA RRRR DDDD %
+% C L I P P B B O O A A R R D D %
+% C L I PPP BBBB O O AAAAA RRRR D D %
+% C L I P B B O O A A R R D D %
+% CCCC LLLLL IIIII P BBBB OOO A A R R DDDD %
% %
% %
% Read/Write Windows Clipboard. %
% May 2002 %
% %
% %
-% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
Image
*image;
- long
- y;
-
- register long
+ register ssize_t
x;
register PixelPacket
*q;
+ ssize_t
+ y;
+
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
if (image_info->debug != MagickFalse)
*/
(void) ResetMagickMemory(&DIBinfo,0,sizeof(BITMAPINFO));
DIBinfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
- DIBinfo.bmiHeader.biWidth=image->columns;
- DIBinfo.bmiHeader.biHeight=(-1)*image->rows;
+ DIBinfo.bmiHeader.biWidth=(LONG) image->columns;
+ DIBinfo.bmiHeader.biHeight=(-1)*(LONG) image->rows;
DIBinfo.bmiHeader.biPlanes=1;
DIBinfo.bmiHeader.biBitCount=32;
DIBinfo.bmiHeader.biCompression=BI_RGB;
RealizePalette(hDC);
}
/* bitblt from the memory to the DIB-based one */
- BitBlt(hDC,0,0,image->columns,image->rows,hMemDC,0,0,SRCCOPY);
+ BitBlt(hDC,0,0,(int) image->columns,(int) image->rows,hMemDC,0,0,SRCCOPY);
/* finally copy the pixels! */
pBits=ppBits;
- for (y=0; y < (long) image->rows; y++)
+ for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (PixelPacket *) NULL)
break;
- for (x=0; x < (long) image->columns; x++)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
- q->red=ScaleCharToQuantum(pBits->rgbRed);
- q->green=ScaleCharToQuantum(pBits->rgbGreen);
- q->blue=ScaleCharToQuantum(pBits->rgbBlue);
- q->opacity=OpaqueOpacity;
+ SetRedPixelComponent(q,ScaleCharToQuantum(pBits->rgbRed));
+ SetGreenPixelComponent(q,ScaleCharToQuantum(pBits->rgbGreen));
+ SetBluePixelComponent(q,ScaleCharToQuantum(pBits->rgbBlue));
+ SetOpacityPixelComponent(q,OpaqueOpacity);
pBits++;
q++;
}
%
% The format of the RegisterCLIPBOARDImage method is:
%
-% unsigned long RegisterCLIPBOARDImage(void)
+% size_t RegisterCLIPBOARDImage(void)
%
*/
-ModuleExport unsigned long RegisterCLIPBOARDImage(void)
+ModuleExport size_t RegisterCLIPBOARDImage(void)
{
MagickInfo
*entry;
entry->encoder=(EncodeImageHandler *) WriteCLIPBOARDImage;
#endif
entry->adjoin=MagickFalse;
- entry->format_type=ExplicitFormatType;
+ entry->format_type=ImplicitFormatType;
entry->description=ConstantString("The system clipboard");
entry->module=ConstantString("CLIPBOARD");
(void) RegisterMagickInfo(entry);
HBITMAP
bitmapH;
- OpenClipboard( NULL );
+ OpenClipboard(NULL);
EmptyClipboard();
bitmapH=(HBITMAP) ImageToHBITMAP(image);
SetClipboardData(CF_BITMAP,bitmapH);