Recent

Author Topic: [CLOSED] BGRAControls  (Read 485732 times)

JanRoza

  • Hero Member
  • *****
  • Posts: 547
    • http://www.silentwings.nl
Re: BGRAControls
« Reply #60 on: May 06, 2011, 08:49:04 pm »
Your controls look promising so I install bgrabitmap and then wanted to install bgracontrols but all I get on compiling bgracontrols is an error message:
Quote
D:\Compilers\lazarus\components\bgracontrols\bgraimagelist.pas(72,15) Error: There is no method in an ancestor class to be overridden: "TBGRAImageList.Draw(TCanvas,LongInt,LongInt,LongInt,TDrawingStyle,TImageType,TGraphicsDrawEffect);"

I'm using Lazarus 09.30.1 with FPC 2.4.2.
Any idea what's wrong?
OS: Windows 10 (64 bit) / Ubuntu 19.04 (64 bit)
Laz: Lazarus 2.0.6 FPC 3.0.4 i386-win32-win32/win64
       Lazarus 2.1.0 FPC 3.3.1 i386-win32-win32/win64
       CodeTyphon 7.1 FPC 3.3.1 i386-win32-win32/win64

Dibo

  • Hero Member
  • *****
  • Posts: 1046
Re: BGRAControls
« Reply #61 on: May 06, 2011, 08:57:42 pm »
You need latest lazarus 0.9.31 from SVN (revision >= 29834)

JanRoza

  • Hero Member
  • *****
  • Posts: 547
    • http://www.silentwings.nl
Re: BGRAControls
« Reply #62 on: May 06, 2011, 09:57:11 pm »
Okay, I overlooked that fact.
Got it.

OS: Windows 10 (64 bit) / Ubuntu 19.04 (64 bit)
Laz: Lazarus 2.0.6 FPC 3.0.4 i386-win32-win32/win64
       Lazarus 2.1.0 FPC 3.3.1 i386-win32-win32/win64
       CodeTyphon 7.1 FPC 3.3.1 i386-win32-win32/win64

Emerson Cavalcanti

  • New Member
  • *
  • Posts: 20
Re: BGRAControls
« Reply #63 on: May 08, 2011, 09:53:51 pm »
Hello,

Here's my small contribution to your project. I created a
component-based TBGRABitmap that lets you crop an image.

TImageManipulation is a component designed to make simple changes in an
image while maintaining the aspect ratio of the final image and allow it
to cut to reduce the unnecessary edges. The selected area is painted
with a different transparency level for easy viewing of what will be
cut.

This is the first version, and including a demo.

Download the code
from https://docs.google.com/leaf?id=0B1bnA-yFlcQZOTc3ZDBjNmEtODYxOS00NWU0LWI3OGEtMDI1NjA5NTQ5Nzcw&hl=en&authkey=CN35wYkM.

I'm working on it a little longer to allow image rotation and other
settings. Let me know if you
need to change something or if I need to adjust the component so it can
be included. If you do not understand any part of the operation, I am at
your disposal.
Sharing knowledge and building the future

lainz

  • Guest
Re: BGRAControls
« Reply #64 on: May 09, 2011, 12:20:48 am »
Attached you can see BGRAImageButton.

It has 4 states:
* Normal
* Enter
* Pressed
* Disabled

Currently only support BMP files without transparency. But can be easy added using TBGRABitmap instead TBitmap.

To use the example you must add and compile the pas file with BGRAControls.

circular

  • Hero Member
  • *****
  • Posts: 3099
    • Personal webpage
Re: BGRAControls
« Reply #65 on: May 09, 2011, 01:08:26 pm »
emersoncavalcanti, the links do not work.

anyway it sounds very interesting.

By the way, it would be more consistent to call it TBGRAImageManipulation to go along with other components.
Conscience is the debugger of the mind

Shebuka

  • Sr. Member
  • ****
  • Posts: 422
Re: BGRAControls
« Reply #66 on: May 10, 2011, 11:42:44 am »
Hi all,
i'm trying to use BGRAImageList.GetBitmap(Index, BGRAButton.Glyph) to assign Glyph to my button with transparent background and getting some really bad glyph with some sort of color inversion... BGRAImageList is design time loaded with bmp with white color transparency.

on the first screen is what i'm using now, an timage and an speedbutton
on the second screen is a BGRAButton (with solid background, but it's same with transparency...)

what i'm doing wrong?

circular

  • Hero Member
  • *****
  • Posts: 3099
    • Personal webpage
Re: BGRAControls
« Reply #67 on: May 10, 2011, 07:59:36 pm »
Strange.
Conscience is the debugger of the mind

picstart

  • Full Member
  • ***
  • Posts: 236
Re: BGRAControls
« Reply #68 on: May 10, 2011, 11:57:56 pm »
Well I set up a spare test PC win Xp for safety and to see if BGRAcontrols would install.
Perhaps I'm overly cautious in heeding the warnings that a snap shot can ruin your system.
There wasn't a Documents and setting references to lazarus folder
 Downloaded and installed the latest snapshot Lazarus-0.9.31-30650-fpc-2.4.2-20110510-win32.exe. The install went fine and it actually ran a "hello world " test. Nice at least 9.31 compiling is working.
Next I selected the package installer and chose to install BGRAbitmap using the lpk
It errors with fcllaz.pas (64,48) Fatal Can't find fcllaz used by Package system
The unit is in c:\lazarus\packager\registration. Is it just me or has anyone got this to work?

circular

  • Hero Member
  • *****
  • Posts: 3099
    • Personal webpage
Re: BGRAControls
« Reply #69 on: May 11, 2011, 01:31:42 am »
Hi all,
i'm trying to use BGRAImageList.GetBitmap(Index, BGRAButton.Glyph) to assign Glyph to my button with transparent background and getting some really bad glyph with some sort of color inversion... BGRAImageList is design time loaded with bmp with white color transparency.

on the first screen is what i'm using now, an timage and an speedbutton
on the second screen is a BGRAButton (with solid background, but it's same with transparency...)

what i'm doing wrong?
I don't see what you can do wrong here. There seem to be a problem with bitmap format. What version of Lazarus are you using and on which system ? Can you post a small project that shows the problem so someone can try to debug and see what happens ?

picstart, I cannot tell you because I am using CodeTyphon.
Conscience is the debugger of the mind

picstart

  • Full Member
  • ***
  • Posts: 236
Re: BGRAControls
« Reply #70 on: May 11, 2011, 02:14:46 am »
I think there are issues here. If I install BGRAbitmap.lpk via the package tab to
a freshly installed snapshot Lazarus-0.9.31-30650-fpc-2.4.2-20110510-win32.exe
it installs with the warning "do you like fat" but it installs nevertheless. However lazarus 9.31 now errors with a heap dump  true free heap 2732608 should be 2621184 this is before an install of BGRAcontrols.lpk. The dump occurs after the rebuild and upon exit from lazarus. Since 9.31 without BGRAbitmap.lpk ( latest version from 3.9 lazpaint) installed or BGRAcontrols.lpk runs hello world the issue is probably with these packages. Bgracontrols has a dependency on 9.31 and a recent build per the wiki. Perhaps there are interdependencies between  controls and bitmap and maybe Codetyphon. System is winXP home edition SP2.

circular

  • Hero Member
  • *****
  • Posts: 3099
    • Personal webpage
Re: BGRAControls
« Reply #71 on: May 11, 2011, 01:05:55 pm »
Well, honestly I don't understand what is going on. Maybe we could add a conditional compiler directive in BGRAImageList so that it does not redeclare the Draw function if it is 0.9.30. This way, you could use it with a stable version of Lazarus. the BGRAImageList would behave just like the standard ImageList in this case. I don't remember the compiler directive to check FPC version.
Conscience is the debugger of the mind

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: BGRAControls
« Reply #72 on: May 11, 2011, 01:12:30 pm »
I don't remember the compiler directive to check FPC version.

There are predefined macros:
FPC_VERSION and FPC_FULLVERSION.

Here is an example:

Code: Pascal  [Select]
  1.   {$ifdef ver2}
  2.      // all versions 2.x
  3.   {$endif}
  4.   {$ifdef ver2_2}
  5.     // all versions 2.2
  6.   {$endif}
  7.    //etc.  
  8.  
  9.    // or (delphi/FPC2+ style):
  10.   {$if (fpc_version=2) and (fpc_release>4) or ((fpc_release=4) and (fpc_patch>1))}  
  11.     {$info At least this is version 2.4.2}  
  12.   {$else}  
  13.     {$fatal Problem with version check}  
  14.   {$endif}
« Last Edit: May 11, 2011, 01:18:24 pm by FabienWang »
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

picstart

  • Full Member
  • ***
  • Posts: 236
Re: BGRAControls
« Reply #73 on: May 11, 2011, 05:09:36 pm »
Small issue with panel. The gradient works just fine up to the bevel. The bevel color is the default button color ( gray) ..this makes the beveled panel look bad , Is there a way to have bevel color and the panel color consistent?
« Last Edit: May 11, 2011, 05:23:17 pm by picstart »

Shebuka

  • Sr. Member
  • ****
  • Posts: 422
Re: BGRAControls
« Reply #74 on: May 11, 2011, 07:14:30 pm »
Hi all,
i'm trying to use BGRAImageList.GetBitmap(Index, BGRAButton.Glyph) to assign Glyph to my button with transparent background and getting some really bad glyph with some sort of color inversion... BGRAImageList is design time loaded with bmp with white color transparency.

on the first screen is what i'm using now, an timage and an speedbutton
on the second screen is a BGRAButton (with solid background, but it's same with transparency...)

what i'm doing wrong?
I don't see what you can do wrong here. There seem to be a problem with bitmap format. What version of Lazarus are you using and on which system ? Can you post a small project that shows the problem so someone can try to debug and see what happens ?

picstart, I cannot tell you because I am using CodeTyphon.
I'm under Mac OS X 10.6.7 with last snapshot (svn rev. 30406) fpc 2.4.2 and last components/bgra

simple example project attached