Resolution Problems with TImageList

Resolution Problems with TImageList

Post by Ron Hile » Wed, 24 Feb 1999 04:00:00



Hello everyone,

I am having a problem with a TImageList component, and I hope someone can
help.

The problem is, when I draw an image from the TImageList onto a paintbox, it
comes up in reduced resolution (16 color, I think).

The image is in 16bpp and the application is running in 16bpp or higher.  I
can load the same image straight onto the same form using a TImage and it
comes up fine.  Unfortunately, I need to load it from an ImageList.

Settings for the TImageList:
 BKColor clDefault
 BlendColor clNone
 DrawingStyle dsNormal
 ImageType itImage
 Masked false

The image is loaded as such:
 ComponentImageList->FileLoad(rtBitmap, "GameArt\\ItemTileTemplate.bmp",
clNone);

It is drawn to the paintbox as such:
  ComponentImageList->Draw(ComponentPaintBox->Canvas, 5,10+80*i, i);

I have no idea why this isn't working. I've tried everything I can think of.
Various combinations of BKColor, BlendColor,  DrawingStyle, and Masked
settings (it shouldn't need a mask, the image is square, but I tried them
anyway).  Also played with the last parameter of the FileLoad() call.  I
even tried messing around with the PaintBox-> Canvas->CopyMode settings. All
to no avail, the image comes up exactly the same every time.

I've already checked Deja news.  You guys are my last hope.  HELP!  I'm
pulling out hair at an alarming rate.

Ron
--
Manifest Destiny - The Race for World Domination
Demo now available!
http://www.veryComputer.com/*ware.com

 
 
 

Resolution Problems with TImageList

Post by Damon Chandle » Thu, 25 Feb 1999 04:00:00


Ron,
        I tried your code with the same results... I think the FileLoad method
is calling TBitmap->IgnorePalette.  Regardless, it's not even worth
wasting anymore time on it.  The following code works...

//Instead of calling ImageList->FileLoad(...), do the following...

Graphics::TBitmap *TempBitmap = new Graphics::TBitmap();
TempBitmap->LoadFromFile("myfile.bmp");
ImageList1->Add(TempBitmap, index);  //set index appropriately
delete TempBitmap;

It's an easy and effective workaround.

Good luck.

Damon Chandler


> Hello everyone,

> I am having a problem with a TImageList component, and I hope someone can
> help.

> The problem is, when I draw an image from the TImageList onto a paintbox, it
> comes up in reduced resolution (16 color, I think).

> The image is in 16bpp and the application is running in 16bpp or higher.  I
> can load the same image straight onto the same form using a TImage and it
> comes up fine.  Unfortunately, I need to load it from an ImageList.

> Settings for the TImageList:
>  BKColor clDefault
>  BlendColor clNone
>  DrawingStyle dsNormal
>  ImageType itImage
>  Masked false

> The image is loaded as such:
>  ComponentImageList->FileLoad(rtBitmap, "GameArt\\ItemTileTemplate.bmp",
> clNone);

> It is drawn to the paintbox as such:
>   ComponentImageList->Draw(ComponentPaintBox->Canvas, 5,10+80*i, i);

> I have no idea why this isn't working. I've tried everything I can think of.
> Various combinations of BKColor, BlendColor,  DrawingStyle, and Masked
> settings (it shouldn't need a mask, the image is square, but I tried them
> anyway).  Also played with the last parameter of the FileLoad() call.  I
> even tried messing around with the PaintBox-> Canvas->CopyMode settings. All
> to no avail, the image comes up exactly the same every time.

> I've already checked Deja news.  You guys are my last hope.  HELP!  I'm
> pulling out hair at an alarming rate.

> Ron
> --
> Manifest Destiny - The Race for World Domination
> Demo now available!
> http://www.veryComputer.com/*ware.com



 
 
 

Resolution Problems with TImageList

Post by Ron Hile » Thu, 25 Feb 1999 04:00:00


Thanks Damon, I'll give that a try.

What would I do without ya?   :)

Ron
--
Manifest Destiny - The Race for World Domination
Demo now available!
http://www.veryComputer.com/*ware.com


>Ron,
> I tried your code with the same results... I think the FileLoad method
>is calling TBitmap->IgnorePalette.  Regardless, it's not even worth
>wasting anymore time on it.  The following code works...

>//Instead of calling ImageList->FileLoad(...), do the following...

>Graphics::TBitmap *TempBitmap = new Graphics::TBitmap();
>TempBitmap->LoadFromFile("myfile.bmp");
>ImageList1->Add(TempBitmap, index);  //set index appropriately
>delete TempBitmap;

>It's an easy and effective workaround.

>Good luck.

>Damon Chandler


 
 
 

1. TImageList Images get corrupt when changing screen resolution

I have a problem that when I change the screen resolution to 256 Colours
to debug the application for that platform, the TImageList images get
corrupted. When doing this a couple of times (going back and forward to
32Bit/16Bit and 256Colours) the images eventually end up as black
silhouettes.

Is there any way to prevent this from happening?

Tasso

2. Looking for PIXAR employee

3. Resolution of Monitor Resolution Problem

4. Smoke/steam effect in pov?

5. Strange problem with TImageList

6. Model a Bird

7. TimageList (Problem);

8. Line and Torus Intersection,Help!

9. TImageList Problem - Please Help

10. invisble Timagelist problems

11. Problems with TImageList

12. TImageList->GetResource problems...

13. TBitmap, TImageList and pf24bit problem