Page 1 of 1

xBrowse - Bitmap - JPG

Posted: Mon Sep 10, 2007 8:43 pm
by Willy
Hello,

I saw an example to use BMP files in a xBrowse()

Is it also possible to use JPG files.

Thanks,

Willy

Posted: Tue Sep 11, 2007 3:04 am
by R.F.
It's not possible, image for using in browses (any kind) should be always BMPs in files or resources.

Posted: Tue Sep 11, 2007 6:12 am
by Antonio Linares
Willy,

You have to use a TImage object that reads the JPG and convert it into a BMP automatically in memory.

Posted: Tue Sep 11, 2007 7:22 am
by Willy
Thanks,

Is there an example.

Greetings,

Willy.

Posted: Wed Sep 12, 2007 7:59 am
by Willy
Therefore I should have to change the txBrowse class.

However this is a complex situation I will give it a try.

Any tips how to start this ?

Thanks,

Willy

Posted: Thu Sep 13, 2007 10:11 am
by Antonio Linares
Willy,

Try this:

Code: Select all

METHOD AddJpgFile( cJpgFile ) CLASS TXBrwColumn

   local hBmp := FILoadImg( cJpgFile )

   AAdd( ::aBitmaps, { hBmp, nBmpWidth( hBmp ), nBmpHeight( hBmp ) } )

return .t.

Posted: Thu Sep 13, 2007 10:44 am
by Willy
Thanks Antonio,

I test this as soon as possible

Willy

Posted: Fri Sep 14, 2007 12:23 pm
by Willy
At this momoent it is already possible to browse JPG files in a xBrowse()

But it only works when there is only 1 dataline. Is it possible with xBrowse to combine bitmaps and multiple datalines.

The JPG is not displayed in the middel of the column. When I give the column the exact width it is not displayed completely.

Thanks

Willy