Mail Archives: djgpp/1997/08/21/03:43:52
Regis BOSSUT wrote:
> Another graphic related question: it is sometimes impossible to save
> a full screen graphics to the clipboard. When I set 16*640*480 mode,
> I can ; when I set 256*640*480, I can't (I get the message
> Impossible to copy the screen contents to the clipboard) ; when I set
> the 256*800*600 mode, I can't neither (sometimes Exception 0E from
> VDD.VXD). So, what is the size limit of the clipboard and can I
> change it ?
>
This is because Win'95 can copy to clipboard only content of screen
with the same resolution and color depth as its screen resolution and
color depth. So, you should switch Win95's resolutions to desired mode
before running your program. It is not complicated to write to clipboard
from DOS using API, I have BP unit that do this (there is BP only, I not
have much time to convert it to DJGPP), but you should know the bitmap
independend format for clipboard.
There is Borland Pascal 7.0 unit WinClip:
unit WinClip;
interface
const
{ clpboard formats ID }
cbfText = 1;
cbfBitmap = 2;
cbfWMF = 3;
cbfSYLK = 4;
cbfDIF = 5;
cbfTIFF = 6;
cbfOEMText = 7;
cbfDIB = 8;
cbfSpecial = $80;
cbfDSPText = $81;
cbfDSPBitmap = $82;
type
TCBBitmap = record
Type_,
Width,
Height,
BytesPerLine : word;
ColorPlanes,
AdjacentColorBits : byte;
DataPtr : pointer;
Width01mm,Height01mm : word;
Data: array [0..65000] of byte;
end;
TCBMetafailData = record
MapMode,
X,Y,
PicData : word;
end;
function cbEnabled:boolean;
function cbVersion:word;
function cbOpen:boolean;
function cbEmpty:boolean;
function cbWrite(f:word; Data:pointer; Size:longint):boolean;
function cbGetSize(f:word):longint;
function cbRead(f:word; Data:pointer):boolean;
function cbClose:boolean;
function cbCompact(Size:longint):boolean;
IMPLEMENTATION
function cbVersion; assembler;
asm
mov ax,1700h
int 2Fh
end;
function cbEnabled; assembler;
asm
mov ax,1700h
int 2Fh
cmp ax,1700h
mov al,1
jne @OK
dec al
@OK:
end;
procedure _clp; near; assembler;
asm
mov ah,17h
int 2Fh
test ax,ax
jz @0
mov al,1
@0:
end;
function cbOpen; assembler;
asm
mov al,1
call _clp
end;
function cbEmpty; assembler;
asm
mov al,2
call _clp
end;
function cbWrite; assembler;
asm
mov dx,f
les cx,Size
mov si,es
les bx,Data
mov al,3
call _clp
end;
function cbGetSize; assembler;
asm
mov ax,1704h
mov dx,f
int 2Fh
end;
function cbRead; assembler;
asm
mov dx,f
les bx,Data
mov al,5
call _clp
end;
function cbClose; assembler;
asm
mov al,8
call _clp
end;
function cbCompact; assembler;
asm
les cx,Size
mov si,es
mov al,9
call _clp
end;
END.
--
Alexander Bokovoy, <bokovoy AT bspu DOT ac DOT by>
---== The Soft Age coming soon ==---
- Raw text -