I am using an OK button to go from one dialog A to dialog B. Dialog B uses the following commands to load a .bmp and .jpg files to the screen. Most of the times there is no problem, but every now and then dialog B fails to load the .bmp file (it always happen to .bmp not .jpg). The file sizes are about 24K and the bmp is (256 color bmp). Anyone any idea why this might happen. Thank you in advance.
Code: Select all
clauses new(Parent) :- dialog::new(Parent), pict := vpi::pictLoad("welldefsch.bmp"), _ = gdiplus_native::gdipLoadImageFromFile("welldefimg.jpg", Image), pictPlus := Image, addMenuItemListener(onMenu), setpaintresponder(onPaint), generatedInitialize(). predicates onPaint : drawwindow::paintresponder. clauses onPaint(_, _, Gdiobject):- Gdiobject:pictDraw(pict, pnt(140,5), vpiDomains::rop_SrcCopy), HDC = Gdiobject:getNativeGraphicContext(IsReleaseNeeded), _ = gdiplus_native::gdipCreateFromHDC(HDC, Graphics), _ = gdiplus_native::gdipDrawImageI(Graphics, pictPlus, 685, 10), _ = gdiplus_native::gdipDeleteGraphics(Graphics), Gdiobject:releaseNativeGraphicContext(HDC, IsReleaseNeeded).