Jump to content

NecoArc

Members
  • Content Count

    5
  • Joined

  • Last visited

Everything posted by NecoArc

  1. I have a project that at some point I need to display many images on the screen at the same time These images are registered by the user, so before I didn't pay attention to the size of the images one of the users was registering 11MB png images which at some point caused the app to crash because the RAM consumption was going too high Then I did a treatment to resize the images and it worked fine... But I can't stop thinking, what if I want to use the images with the best possible resolution? even on devices with high performance, the RAM consumption is huge, eight 11MB images displayed on the screen at the same time use 500MB+ i have a loop that create frames and do something like: for product in menu do begin frame:= TFrmImageItem.create(product, 'imagePath'); layoutFrmImageItem.addObject(frame); end; constructor TFrmImageItem.create(product:TProduct, imagepath:string); var bitmap:TBitmap begin lbName.text:=product.name; bitmap := tbitmap.create; bitmap.setSize(TSize.create(200,200)); bitmap. LoadFromFile(imagePath); Timage.bitmap.assign(bitmap); bitmap.free; end i wonder what else can be done to reduce the memory consuption without resizing the images i've alredy implemented a virtualization method to set frameVisible:=false when the frame is not on the screen also a double buffer method (wich didn't work well) i wonder if you guys can provide me any ideas maybe the memory is skyrocketing because i'm using frames?
  2. thanks for the suggestions guys i'll see what i can do now (also this website is really annoying it was saying my IP was blocked because of spam but it's the first time i'm using this community )
  3. that code was just a small exemple i have a generic function that returns me a lot of diferent types of bitmaps depending on my object, but there was no point into showing everything also, you're right in point 1. i took off the bitmap.setsize and it made no difference at all i'll give a try on your suggestion
  4. thanks i'll give it try first time i've heard of this method
  5. NecoArc

    Listbox with images scrolls not smoothly

    i'm having the same problem and is so anoying, i have a vertscrollbox that i populate with frames the more frames i have the worst it gets one of the solutions i found was to set frame.visible:=false, when the frame is not showing on the scroll the second was setting the image on each frame to visible:=false while scrolling the second one brought a significative enhancement, but setting the image to visible false while scrolling is just dumb changing form.quality property didn't change too much options systemDefault and highQuality were basically the same while highPerformance make the scroll animation even worst i really don't understand why this is like this since the list view component can scroll smothly, but infortunelly i had to change it since it was using too much memory and was crashing the application in low performance devices i'll try to install alcione to see how it works using delphi 12.1
×