Alpha Image Device

Byak@

Active Member
Licensed User
eww245 big thanks) i'm use a
a.GetImageSection (sprite.NextX, sprite.NextY, 24, 24)
ai.DrawBitmap (a.ImageSection, 0, 0, 24, 24)
ai.DrawImage (AppPath&"\w.png", 0, 0, 24,24)
sprite.LoadBitmap(ai.Image, 1, 24, 24, 1)
in my program.all my sprites have a one frame every time(i'm change frames when it is needed) and it is a realy work faster.
i'm very wait GetImageSection for AlphaImage :-[
 

eww245

Member
Licensed User
eww245 big thanks) i'm use a
a.GetImageSection (sprite.NextX, sprite.NextY, 24, 24)
ai.DrawBitmap (a.ImageSection, 0, 0, 24, 24)
ai.DrawImage (AppPath&"\w.png", 0, 0, 24,24)
sprite.LoadBitmap(ai.Image, 1, 24, 24, 1)
in my program.all my sprites have a one frame every time(i'm change frames when it is needed) and it is a realy work faster.
i'm very wait GetImageSection for AlphaImage :-[

Glad to see it's working for you, I have added a new version in the first post. GetImageSection for AlphaImage is included.
For the sprites I recommend using AlphaImage as the backbuffer along with another for the sprite image.

I've changed the drawing method for AlphaImage.
Instead of using IImage.Draw it now uses a premultiplied alpha channel with the AlphaBlend API.
This is more memory efficient and draws much faster.
 

Byak@

Active Member
Licensed User
Dear eww i have a problem.in new version i could find a GetImageSection in AlphaDesctop.dll ,only in Alpha.dll... but as you know alpha.dll doesnt work on PC:(
 

eww245

Member
Licensed User
Dear eww i have a problem.in new version i could find a GetImageSection in AlphaDesctop.dll ,only in Alpha.dll... but as you know alpha.dll doesnt work on PC:(

Sorry about that, haven't been doing anything with that one.
I uploaded the changes.
 

Byak@

Active Member
Licensed User
Thanks!
 

Byak@

Active Member
Licensed User
hello eww245!
what you say about correcting draw methods?
now it is not real to draw a part of images. maybe you do it as in ImageLibEx.dll ?
draw(image,source rectangle,target rectangle)
 

eww245

Member
Licensed User
hello eww245!
what you say about correcting draw methods?
now it is not real to draw a part of images. maybe you do it as in ImageLibEx.dll ?
draw(image,source rectangle,target rectangle)

Sorry to respond so late I've been working alot, but that's not a problem to do.
I'll set it up with an int() array vs a rectangle, it will work fine with a Basic4ppc array.

I'm also working on a GetThumbnail/Thumbnails method, it can retain the image quaily rather than just drawing the image small.

Just got a TP2, finally a PPC made in this century!!!!
Anyway, I can now properly set it up for AutoScale, if it doesn't already work.

I make the changes in the next few days.
 

eww245

Member
Licensed User
Version 5 has been posted with a few new items.

GetThumbnails will draw transparent or non-transparent thumbnails.
Amount of rows and cols must be specified. For now, the Desktop version is a dummy.

DrawImage methods were renamed to DrawIImage to avoid possible confusion and to correspond with the API name.

DrawIImage4 was added with destRect and srcRect parameters, as an Int32 Basic4ppc array.

ImageList was renamed to ImageListEx. Images will be disposed of when adding an image to an index, and a DisposeImage method was added.

An example thumbnail/folder browser and the updated original demo are included.

AutoScale sill needs some work. I will also start on the help file soon.
 

Byak@

Active Member
Licensed User
very good work!Thx
 

corwin42

Expert
Licensed User
Longtime User
Hi eww245,

are you still working on this library?

I'm currently trying to create alphablended Imagebuttons. My first approach is to use the ImageLibEx from agraham. This works but I have to create separate image files with the alpha information on the desktop and I don't like this solution.

Then I remembered your alpha library and I want to give it a try. The example code is a bit confusing to me. I didn't have any success to create a simple button alpha blended with the background. Do you have a simple example for this?

Will you provide the source for merging into the executable?

Thanks,
Markus
 

sitajony

Active Member
Licensed User
Hi eww245 can you send me your code source coz I'm using an other lib who contain already "Alpha" class so on Basic4PPC unable to use your lib... I did my own lib but I used OpenNETCF... Or maybe can you just rename the class Name from "Alpha" to "Alpha2" just for me but if you want you can also send me the source code and I'll compile it:)
Thanks!

Edit:
Is it normal that my images are in very bad quality when I draw an image on a bitmap? With OpenNETCF it was in good quality but now it's blured...
 
Last edited:
Top