Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Probleme beim Rahmenzeichnen

Empfohlene Antworten

Veröffentlicht

guten morgen,

Ich möchte in der Win32 Konsole einen Rahmen zeichnen...

Die oberste Begrenzung sieht ganz ok aus - allerdings werden danach nur noch die 2 Ränder neben einander gezeichnet - die unterste Seite ist garnicht da

src:


// Rahmen.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.

//


#include "stdafx.h"

#include <iostream>

#include <conio.h>

#include <windows.h>


//Warnung ausschalten: Verkuerzung eines konstanten Wertes

#pragma warning (disable : 4309 ) 


using namespace std;


HANDLE gotoxy(int,int);

void drawBorder(int,int,int,int);


int _tmain(int argc, _TCHAR* argv[])

{

	HANDLE hStdout = gotoxy(0,0);

	CONSOLE_SCREEN_BUFFER_INFO CSBI;

	GetConsoleScreenBufferInfo(hStdout, &CSBI);

	char zeichen1 = 218;

	int maxX = CSBI.dwSize.X;

	int maxY = CSBI.dwSize.Y;

	drawBorder(0,0,maxX,maxY);

	gotoxy(25,25);

	return 0;

}


HANDLE gotoxy(int x, int y)

{

	HANDLE hStdout;

	COORD coordScreen = {x,y};

	hStdout = GetStdHandle(STD_OUTPUT_HANDLE);

	SetConsoleCursorPosition( hStdout, coordScreen);

	return hStdout;

}



void drawBorder(int x1, int y1, int x2, int y2)

{

	char i = 201;

	int u;

	gotoxy(x1,y1); cout << i;

	i = 188;

	gotoxy(x2,y2); cout << i;

	i = 187;

	gotoxy(x2,y1); cout << i;

	i = 200;

	gotoxy(x1,y2); cout << i;


	i = 205;


	//vertikal

	for((u=(x1+1)); u < x2; u++)

	{

		gotoxy(u,y1); cout << i;

		gotoxy(u,y2); cout << i;

	}


	//horizontal

	for((u=(y1+1)); u < y2; u++)

	{

		gotoxy(x1,u); cout << i;

		gotoxy(x2,u); cout << i;

	}

}

jemand ne idee?

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.