chooser.gadget and GA_Image

This forum is for general developer support questions.
Post Reply
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

chooser.gadget and GA_Image

Post by chris »

I just tried to create a chooser.gadget, pull-down variety, with an image on the button that you click on. It works, however I was a bit confused as the image appears to have dithered itself down to 8-bit.

The chooser is created as basically as possible, then the image is updated afterwards like this:

Code: Select all

  bmo = BitMapObject,
     BITMAP_Screen, screen,
//     BITMAP_Masking, TRUE,
//     BITMAP_HasAlpha, TRUE,
     BITMAP_Width, 16,
     BITMAP_Height, 16,
     BITMAP_BitMap, bm,
    BitMapEnd;

    RefreshSetGadgetAttrs((struct Gadget *)objects[GID_CHOOSER],
     win, NULL,
    GA_Image, bmo,
     TAG_DONE);
With BITMAP_Masking/BITMAP_HasAlpha enabled the image does not display at all (I can see a "ghost" image, but that's it). As above it works but the image is clearly dithered.

What am I doing wrong?

edit Forgot to mention - if I blit this bitmap to the window it displays correctly, so the bitmap itself is fine.
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: chooser.gadget and GA_Image

Post by chris »

Just spotted this: http://www.os4coding.net/forum/dropdown-chooser-image
So, it looks like the weird ghostly image thing is fixed, but is the dithery display in my example above also fixed?
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: chooser.gadget and GA_Image

Post by salass00 »

chris wrote:Just spotted this: http://www.os4coding.net/forum/dropdown-chooser-image
So, it looks like the weird ghostly image thing is fixed, but is the dithery display in my example above also fixed?
Looks OK to me using an AISS image at least:
Image

You say you tried blitting the bitmap to the window and it looked correct but have you tried rendering the image directly with DrawImageState() and does it still look correct?

Also as I said to tbreeden on os4coding.net if you have or can make a simple test case that I can use then that will save me some time looking into this.
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: chooser.gadget and GA_Image

Post by chris »

salass00 wrote:Also as I said to tbreeden on os4coding.net if you have or can make a simple test case that I can use then that will save me some time looking into this.
I can't check atm, but I think if you take out line 80 that will show my problem.
Basically I was getting the ghostly image and removing masking/alpha gives the 8-bit image, so removing the masking tag should do the same thing.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: chooser.gadget and GA_Image

Post by salass00 »

Using the following code:
https://dl.dropboxusercontent.com/u/265 ... pimgtest.c

I get the same result when using either DrawImageState() or BltBitMapTags() (using latest public versions of components only):
Image

I also tried changing the ChooserImgTest.c code as you suggested (setting BITMAP_Masking to FALSE instead) but it still looks correct AFAICT except that there is solid colour where the background was showing through before as the alpha channel is no longer used.
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: chooser.gadget and GA_Image

Post by chris »

salass00 wrote:I also tried changing the ChooserImgTest.c code as you suggested (setting BITMAP_Masking to FALSE instead) but it still looks correct AFAICT except that there is solid colour where the background was showing through before as the alpha channel is no longer used.
I couldn't particulary see any difference with the AISS images. With "add" the plus was a bit darker.
However, if you download Google's favicon and point the code to that instead, you can clearly see the dithering on the chooser gadget version.

I would have attached a screenshot but the whole thing ended up freezing up and I was working in RAM:
Post Reply