how is this possible, do I have to use direct X
Thanks :)
Printable View
how is this possible, do I have to use direct X
Thanks :)
You don't have to use DirectX, but it's very bad form to change the user's resolution if you're not running full-screen. Also, why would you ever want to use a resolution of 320 x 200?
i don't think that today's monitors even support that low of a resolution; and i'm not sure if newer operating systems like xp do. In fact, i didn't think that it was even possible to run lower than 640x480 with win95
They do, but not via API. Windows won't accept any resolution lower than 640x480, you have to use DX for such low resolutions.
You can do it in C with interrupt 10h mode 13h
I used to program in 13h about 5 years ago...
Unfortunatelly in this mode you have to program everything, I mean to draw a line, you have to make your own function to draw that line, same with everything else.
here are some functions I used...
Code://pointer to graphic mode (pixelated)
unsigned char *vga = (unsigned char *)MK_FP(0xA000, 0);
// mode for 300x200 is 0x13 (hex 13)
void vga_init(char mode)
{
// union REGS inregs, outregs;
asm mov ah, 0
asm mov al, mode
asm int 0x10
// inregs.h.ah=0;
// inregs.h.al=mode;
// int86(0x10, &inregs, &outregs);
}
char vga_getmode()
{
char mode;
asm mov ah,0x0f
asm int 0x10
asm mov mode,al
return mode;
}
void WaitRast()
{
asm mov dx,0x3da
bra1:
asm in al,dx
asm and al,8
asm jnz bra1
bra2:
asm in al,dx
asm and al,8
asm jz bra2
}
int getpix(int x, int y, unsigned char far *v)
{
int color = -1;
if(x < 320 && x > -1 && y < 200 && y > -1)
color = v[(y<<8) + (y<<6) + x];
return color;
}
void putpix(int x, int y, unsigned char color, unsigned char far *v)
{
if(x < 320 && x > -1 && y < 200 && y > -1)
v[(y<<8) + (y<<6) + x] = color;
// if(x < 640 && x > -1 && y < 480 && y > -1)
// { //v[(y<<9) + (y<<7) + x] = color;
// v[(640*y)+x] = color;
// }
return;
}
#define uint unsigned int
void putpixel(uint x, uint y, uchar col)
{
uint width = 320;
asm mov ax, 0xA000
asm mov es, ax
asm mov ax, width
asm mov bx,[y]
asm mul bx
asm add ax,[x]
asm mov di, ax
asm mov al,[col]
asm mov [es:di], al
}
WinNT/2k/XP will block that and immediatly kill your app most likely. Unless it's a real DOS application, then they even might let them do it. But then it's not a VB app.