Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

reload bitmaps with maxscript
show user profile  ravihara
I coded a tool that i can transfer pose data from one workstation to another, easily using INI files. Recently i added this new window (1) that pops up when we select a pose from the list box (2), giving a thumbnail of the pose.
my problem is, when i replace/update an existing pose, my function that overwrittes the old thumbnail image do its work properly (as you can see in (3), the old image is replaced by the new one),
but my code that loads the thumbnail, when i select an item from the pose list still loads the old thumbnail of the replaced pose.(as you can see in the (1) window)
this problem exist until i restart max.
so how can I get rid of this old thumbnail 'cache'- (i suppose) and make my listbox click even load the new bitmap? (as you can see by the code i used in the end of the thread i even tried freeSceneBitmaps() function, but no good)



here is my code


on expression_list selected nameIndex do
(
--make text box have the slected item's name

set_textbox_to_sel_name()


looking_bitmap=openBitMap (getFilenamePath(getSourceFileName()) + "\\snapgrabs\\"+ edt1.text + ".jpg")

if looking_bitmap != undefined then (
--reads the dimentions of the current looking bitmap
looking_bitmap_w = looking_bitmap.width
looking_bitmap_h = looking_bitmap.height


createdialog thumbview looking_bitmap_w looking_bitmap_h style:#(#style_toolwindow)


thumbview.thumbnail.width= looking_bitmap_w
thumbview.thumbnail.height= looking_bitmap_h

freeSceneBitmaps()
thumbview.thumbnail.filename = (getFilenamePath(getSourceFileName()) + "\\snapgrabs\\"+ edt1.text + ".jpg")

)
else DestroyDialog thumbview
)





read 549 times
7/13/2014 7:56:08 PM (last edit: 7/13/2014 8:02:08 PM)
show user profile  br0t
what is thumbview.thumbnail exactly? I recommend you to use imgTags if you dont do so yet

never get low & slow & out of ideas


read 518 times
7/14/2014 11:01:38 PM (last edit: 7/14/2014 11:01:45 PM)
show user profile  ravihara
it is a imgTags that is named thumbnail, that is in the dialog thumbview.


read 510 times
7/15/2014 7:45:33 AM (last edit: 7/15/2014 7:45:33 AM)
#Maxforums IRC
Open chat window


Support Maxforums.org