You are not logged in.

  • Login

1

Monday, February 27th 2006, 11:27am

Bild anzeigen lassen in C++

Soa , mein erster Post :)
Ich habe spaßeshalber mal mit C++ angefangen und kam bis jetzt ganz gut voran ,doch jetzt habe ich ein kleines Problem.

Ich möchte ein Bild in einem stinknormalen Windows Fenster anzeigen , mehr nicht. Habe bis jetzt nichts gefunden , was mich weiter gebracht hätte. Ich bin für jede Hilfe dankbar , wäre wirklich nett :wink:
Als Compiler benutze ich Dev C++ , hab bis jetzt nichts besseres gefunden.

Danke für eure Hilfe


PloKoon :D

2

Monday, February 27th 2006, 11:58am

C Quellcode

1
2
3
TJPEGImage *jpg = new TJPEGImage();
jpg->LoadFromFile("bild.jpg");
Image->Picture->Assign(jpg);


hm. meinst du jetzt das?

3

Monday, February 27th 2006, 1:05pm

Danke für deine Hilfe :) Könntest du mir jetzt noch eventuell etwas genauer erklären wie ich das einbaue.
Also nach

#insert <windows>

:D

4

Monday, February 27th 2006, 2:28pm

tja... was genau muss man includen..
das weiß ich grad auch nicht... hab sowas zuletzt mim borland gecoded, da ging das so
versuch mal ob wenigstens BMPs funktionieren

C Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
TImage* lab;
 
void main()
{	
	lab = new TImage(this);
	lab->Parent = this;
	lab->Width = 100;
	lab->Height = 100;
	lab->Top = 0;
	lab->Left = 0;
	lab->Picture->LoadFromFile("test.bmp");
}

5

Monday, February 27th 2006, 3:03pm

Ichh hab nur so ne Uralt Version von Borland , V 4.5
Damit gehts wohl nit , mit Dev C++ auch nit. Oder ich hab was falsch gemacht

6

Monday, February 27th 2006, 5:06pm

ach du hast auch den borland..
was hast du denn so includet?

hier mal ein ausschnitt aus einem alten quellcode...

C Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <vcl.h>
#pragma hdrstop 
#include "Unit1.h"
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
TImage* lab[20][20];   //Array der Buttons
 
void main()
{
for (p=0;p<10;p++)
  {
     for(q=0;q<8;q++,r++)
     {
                     lab[p][q] = new TImage(this);
                     lab[p][q]->Parent = this;
                     lab[p][q]->Width = 32;
                     lab[p][q]->Height = 32;
                     lab[p][q]->Top = p * 32 + 60;
                     lab[p][q]->Left = q * 32 + 28;
                     lab[p][q]->Picture->LoadFromFile("wasser.bmp");
     }
  }
}

7

Monday, February 27th 2006, 5:32pm

Ja , so hat ich mir den Code auch vorgestellt. Ich werde das jetzt mal ausprobieren , hoffe es klappt :wink:


Edit : Hm , klappt nit. Er meldet ne Menge Fehler , das ich ein paar .h files nit habe etc. Ich denke das liegt an meiner Uralt Version

<!-- ich lad mir heute abend noch ne neuere //-->
Amazon Bestellung sollte heute Abend kommen

8

Monday, February 27th 2006, 10:59pm

Öhm , welcher Admin ediert da menen Beitrag ? Welche Amazonbestellung ? :shock:


Ach so , ich verstehe....


Also nochmal : Ich lade mir LEGAL eine neuere Version ;-)

9

Tuesday, February 28th 2006, 5:04pm

Hey,
was ganz gut ist zum Bilder erstellen und bearbeiten ist die OpenCV Library von Intel.
http://www.intel.com/technology/computing/opencv/index.htm

Probier das mal aus!

Similar threads

Social bookmarks