Page 1 of 1

Borland Builder 5 - how to load an image into TImage control

Posted: Thu Nov 30, 2006 12:01 pm
by voja21
I want to load picture (PNG) into TImage control. However, I don't know how to convert GFL_BITMAP to TImage. I have one control Image1 on my form. Here is the portion of my code from main form constructor:

Code: Select all

__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
	{
	GFL_LOAD_PARAMS load_option; 
	GFL_BITMAP *bitmap;
	GFL_FILE_INFORMATION file_info;
	GFL_ERROR error;

	gflLibraryInit();
	gflEnableLZW( GFL_TRUE );
	gflGetDefaultLoadParams( &load_option ); 
	error = gflLoadBitmap( "D:\\C++ projekti\\_probni\\picture load demo\\XYZ.png", &bitmap, &load_option, &file_info );

	gflLibraryExit();
	}
This code so far works well (error is 0), I can access file_info properties to check that PNG dimensions are correct, but what further to do?
I looked at Delphi sample code, but it seems pretty complicated.
Could somebody help me or send some example code?

TIA, Voja