Вниз
Скачать: CL | DM;

Пишу games mahgong, и пытаюсь загрузить много Bitmap-ов в память   Найти похожие ветки 

 
Tea_pot   (2002-11-01 12:28) [0]

Выдает сообщение что недостаточно памяти для выполнения команды,
как быть?


 
han_malign ©   (2002-11-01 12:53) [1]

Это что же за Bitmap-ы, если виртуальной памяти не хватает.
З.Ы. Вероятнее всего не хватает не памяти, а ресурсов(на handle-ы HBitmap), практикуется объединение всех картинок одинакового размера в одну и выдергивание нужной из нужного места в большой, на этом принципе реализован TImageList - копай его, или как сделано в RXLib:
procedure AssignBitmapCell(Source: TGraphic; Dest: TBitmap; Cols, Rows,
Index: Integer);
var
CellWidth, CellHeight: Integer;
begin
if (Source <> nil) and (Dest <> nil) then begin
if Cols <= 0 then Cols := 1;
if Rows <= 0 then Rows := 1;
if Index < 0 then Index := 0;
CellWidth := Source.Width div Cols;
CellHeight := Source.Height div Rows;
with Dest do begin
Width := CellWidth; Height := CellHeight;
end;
if Source is TBitmap then begin
Dest.Canvas.CopyRect(Bounds(0, 0, CellWidth, CellHeight),
TBitmap(Source).Canvas, Bounds((Index mod Cols) * CellWidth,
(Index div Cols) * CellHeight, CellWidth, CellHeight));
end
else begin
Dest.Canvas.Brush.Color := clSilver;
Dest.Canvas.FillRect(Bounds(0, 0, CellWidth, CellHeight));
Dest.Canvas.Draw(-(Index mod Cols) * CellWidth,
-(Index div Cols) * CellHeight, Source);
end;
end;
end;

(c)RxLib


 
Tea_pot   (2002-11-01 13:01) [2]

Вон в чем дело!Спасибо большое!



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.012 c
4-34291
Steven
2002-10-01 07:00
2002.11.11
Export table


1-34096
k-sergey
2002-10-30 11:41
2002.11.11
Как можно что то запихать в Exe файл?


1-34111
kserg@ukr.net
2002-10-31 17:47
2002.11.11
ошибка BORDBK50.dll is missing or not registred


7-34280
Master Noname
2002-09-04 12:24
2002.11.11
Driver for USB


3-33890
Fad
2002-10-22 14:11
2002.11.11
Ошибка в БД. Borland TUtility не помогает.




   Наверх