Problem importing sprites

Started by Marion, Mon 03/03/2025 19:57:14

Previous topic - Next topic

Marion

Hello. I have a big problem with my current game. I can't import a new sprite without it crashing and cutting without saving. I know I have a lot of them (I'm up to more than 20,000) but I need them for this project... Here are the error messages I get when importing new sprites:


Error: Région bitmap déjà verrouillée.
Version: AGS 4.00.00.13

System.InvalidOperationException: Région bitmap déjà verrouillée.
   à System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format, BitmapData bitmapData)
   à System.Drawing.Bitmap.LockBits(Rectangle rect, ImageLockMode flags, PixelFormat format)
   à CreateBlockFromBitmap(Bitmap bmp, RGB* imgpal, Int32* srcPalLen, Boolean fixColourDepth, Int32 destColorDepth, Boolean keepTransparency, Int32* originalColDepth)
   à CreateNativeBitmap(Bitmap bmp, Int32 destColorDepth, Int32 spriteImportMethod, Boolean remapColours, Boolean useRoomBackgroundColours, Boolean alphaChannel, Int32* out_flags)
   à AGS.Native.NativeMethods.SetSpriteFromBitmap(Int32 spriteSlot, Bitmap bmp, Int32 destColorDepth, Int32 spriteImportMethod, Boolean remapColours, Boolean useRoomBackgroundColours, Boolean alphaChannel)
   à AGS.Editor.NativeProxy.CreateSpriteFromBitmap(Bitmap bmp, SpriteImportColorDepth dstColorDepth, SpriteImportTransparency transparency, Boolean remapColours, Boolean useRoomBackgroundColours, Boolean alphaChannel)
   à AGS.Editor.Utils.SpriteTools.ImportNewSprite(SpriteFolder folder, Bitmap bmp, SpriteImportOptions options)
   à AGS.Editor.Utils.SpriteTools.ImportNewSprites(SpriteFolder folder, Bitmap bmp, SpriteImportOptions options, SpriteSheet spritesheet)
   à AGS.Editor.SpriteImportWindow.DoImport()
   à AGS.Editor.SpriteImportWindow.btnImportAll_Click(Object sender, EventArgs e)
   à System.Windows.Forms.Control.OnClick(EventArgs e)
   à System.Windows.Forms.Button.OnClick(EventArgs e)
   à System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   à System.Windows.Forms.Control.WndProc(Message& m)
   à System.Windows.Forms.ButtonBase.WndProc(Message& m)
   à System.Windows.Forms.Button.WndProc(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Crimson Wizard

#1
AGS supports up to 90k imported sprites. There's a known issue that Editor may run out of memory if you imported a big number of sprites during same session without saving (this is resolved by saving periodically).

The error sounds like some internal problem in the editor. I don't know in which situations it may appear though.
Does this happen to any image file or particular ones?
Does this happen when you just started to work with the editor, or being working with it for a while?


Marion

It happens when I import too many sprites at one time, I think. It seems to be ok when I import less sprites and then save.
Thank you for your answer :)

SMF spam blocked by CleanTalk