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

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, xnview

Post Reply
voja21
Posts: 2
Joined: Thu Nov 30, 2006 10:37 am
Location: Belgrade

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

Post 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
Post Reply