SRL Archive - Help

Bitmaps


masterBB

2011-10-14 06:30:52

I'm writing a tutorial about drawing on screen. To show some different techniques I need to all about bitmaps and I still got some problems with that.

A bitmap as Integer
  • Probably loaded into the memory somewhere, I only get the number.
  • Can create a TMufasaBitmap out of it by GetMufasaBitmap.
  • It has no drawing canvas property I can access.

A bitmap as TBitmap
  • I got a canvas.
  • I can't draw it on another canvas/bitmap.
  • Can't create any othere type of bitmap out of it.

A bitmap as TMufasaBitmap
  • Got no canvas.
  • Can create a TBitmap out of it.
  • Can get it back as integer if it was created as integer.
  • Can be drawn on a canvas.

I need a bitmap(or 2 which can be exchanged)
  • With a canvas.
  • Can be drawn on another canvas.

edit: before I forget and someone spends hours on this. This will be probably be solved with a fix to simba.

Wizzup?

2011-10-14 11:06:55

As of this (https://www.moparisthebest.com/jenkins/job/Simba_Next/lastBuild/) Simba-next, the following works now:


program new;
var
m: TMufasaBitmap;
b: TBitmap;
begin
b := TBitmap.Create;
b.Width := 42;
b.Height := 42;
m := TMufasaBitmap.Create;
m.LoadFromTBitmap(b); // And don't forget you also have ToTBitmap. :)
writeln(m.Width);
b.Free;
m.Free;
end.

masterBB

2011-10-14 14:21:37

You're my hero!