Page 1 of 5

BOS TAURUS: Questions and Suggestions

Posted: Tue Nov 06, 2012 1:27 am
by srvet_claudio
Hi all.
As suggested by Daniel Maximiliano, I created here a topic for questions and suggestions on Bos Taurus (graphic library for HMG).
Best Regards,
Claudio Soto.

Re: BOS TAURUS: Questions and Suggestions

Posted: Tue Nov 06, 2012 4:09 am
by Rathinagiri
Hi,

First of all I wish the best for this graphics library.

For me HMG is just the sweet wrapper of clipper/harbour over the bitter c/c++. Roberto's design of hiding the inner parts of the logic which the user need not know about is very successful. A person who starts using HMG doesn't need to know about Device Context for example.

So, my humble suggestion is having wrapper functions or an alternate syntax like the below:

Code: Select all

DEFINE GRAPHICSAREA of  Form1
   DRAW LINE FROM nRow, nCol TO nRow, Col COLOR { nR, nG, nB }
   DRAW CIRCLE AT nRow, nCol RADIUS nRadius
   DRAW IMAGE cPicture AT nRow, nCol
END GRAPHICSAREA

CLEAR GRAPHICS AREA OF Form1 FROM nRow, nCol TO nRow, nCol

Re: BOS TAURUS: Questions and Suggestions

Posted: Tue Nov 06, 2012 4:45 am
by srvet_claudio
rathinagiri wrote:So, my humble suggestion is having wrapper functions or an alternate syntax like the below:

Code:
DEFINE GRAPHICSAREA of  Form1
   DRAW LINE FROM nRow, nCol TO nRow, Col COLOR { nR, nG, nB }
   DRAW CIRCLE AT nRow, nCol RADIUS nRadius
   DRAW IMAGE cPicture AT nRow, nCol
END GRAPHICSAREA

CLEAR GRAPHICS AREA OF Form1 FROM nRow, nCol TO nRow, nCol
Thanks Rathi, very good and very wise suggestion.

Re: BOS TAURUS: Questions and Suggestions

Posted: Wed Nov 07, 2012 12:34 pm
by srvet_claudio
mol wrote:I have a question - I've read documentation of Bos Taurus, and it looks it is possible to create image file with this library. Am I right?
If yes, can you place a little sample presenting creating images?
I'm working on a little label maker and I want to build preview of label - it could be easy with BT...
Hi Marek,
Here leave you an example, I hope you find useful.
Best regards,
Claudio

Re: BOS TAURUS: Questions and Suggestions

Posted: Thu Nov 08, 2012 6:31 am
by mol
As wonderful as simple!
It will be great supplement for label generator, which I built-in my billing application.
I'll try to prepare standalone working sample.


I found and used BT_BitmapSaveFile(hBitmap, cFileName)
Working fine, but, how to output generated image to png/jpg file?
Is it possible?

Second question: Is there a method to set horizontal and vertical DPI parameter?
Many thanks, Claudio!

Re: BOS TAURUS: Questions and Suggestions

Posted: Thu Nov 08, 2012 12:58 pm
by srvet_claudio
mol wrote:It will be great supplement for label generator, which I built-in my billing application.
Hi Marek.
I'm glad you find it useful.
mol wrote:I'll try to prepare standalone working sample.
Please post here to see it.
mol wrote:One question: how to output generated image to png/jpg or bmp file?
Very easy.

BT_BitmapSaveFile (hBitmap, cFileName)
Save an image in format BMP (24 bpp) in the disk.
hBitmap: is a handle to the bitmap image.
cFileName: is the name of the file to save.

Best Regards,
Claudio.

Re: BOS TAURUS: Questions and Suggestions

Posted: Thu Nov 08, 2012 1:08 pm
by srvet_claudio
mol wrote: I found and used BT_BitmapSaveFile(hBitmap, cFileName)
Working fine, but, how to output generated image to png/jpg file?
Is it possible?
No, BT only saves images in BMP format (24 bpp), you would have to convert the final image into Windows Paint, etc.
mol wrote: Second question: Is there a method to set horizontal and vertical DPI parameter?
Again the answer is no :(

Regars,
Claudio.

Re: BOS TAURUS: Questions and Suggestions

Posted: Thu Nov 08, 2012 2:07 pm
by mol
THX again!
I'll try to find solution...
Marek

Re: BOS TAURUS: Questions and Suggestions

Posted: Thu Nov 08, 2012 3:05 pm
by Rathinagiri
Hi Marek,

I think you can use hbfimage library.

http://freeimage.sourceforge.net/features.html

These are the features.

Re: BOS TAURUS: Questions and Suggestions

Posted: Thu Nov 08, 2012 5:39 pm
by mol
I worry I'm not familiar with C language too ehough to use such a library :(