![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi all.
I finally buy this wonderfull app. Now i have more doubts than ever! I have problems using imagelib library. The problem is the following, when i create a bitmap with backdrop image, I create a drawer and paint a bit image over previous, using drawer.drawimage1 When I first time, try to draw in a gamewindow.drawbackgroundimage2, all seems to be correct, but the second time, value doesn't work. I have to use an intermediate image for storing value of backdropbitmap and reassign every time. The code is follow. Code:
Sub UpdateForm(x, y) CellBitmap.New1(AppPath & "\images\cell.png") 'BackdropBitmap.New3(TmpBackdropBitmap.Value) CellRectangle.New1(0, 0, CellBitmap.Width, CellBitmap.Height) BackdropRectangle.New1(x, y, CellBitmap.Width, CellBitmap.Height) GameFormDrawer.New2(BackdropBitmap.Value, B4PObject(5)) GameFormDrawer.DrawImage1(CellBitmap.Value, CellRectangle.Value, BackdropRectangle.Value, false) GameFormDrawer.Refresh2(BackdropRectangle.Value) 'TmpBackdropBitmap.New3(BackdropBitmap.Value) GameGameWindow.DrawBackgroundImage2(BackdropBitmap.Value) End Sub I commented 2 lines needed to work, and i wonder why I need this 2 lines. Any Clues? Thanks in advance. fjsantos. |
|
|||
|
Hi Klaus
Thanks for helping. Code is a bit large so I extract important part. Code:
Sub App_Start
GameFormLib.New1("GameForm", B4PObject(1))
GameGameWindow.New1("GameForm", 0, 0, WIDTH, HEIGHT)
GameGameWindow.DrawBackgroundImage(AppPath & "\images\backdrop.png")
ObjectDoor.New1(False)
ObjectDoor.FromControl("GameForm")
ObjectDoor.SetProperty("KeyPreview", True)
TmpBackdropBitmap.New1(AppPath & "\images\backdrop.png")
GameForm.Image = TmpBackdropBitmap.Value
GameForm.Show
GameForm.ForeLayer = True
CreateCloseButton
CreateNewCell
UpdateForm1
MoveCellTimer.Enabled = True
End Sub
Sub UpdateForm1
CellBitmap.New1(AppPath & "\images\cell.png")
CellRectangle.New1(0, 0, CellBitmap.Width, CellBitmap.Height)
BackdropRectangle.New1(0, 0, CellBitmap.Width, CellBitmap.Height)
GameFormDrawer.New1("GameForm", True)
End Sub
Sub UpdateForm(x, y)
BackdropRectangle.X = x
BackdropRectangle.Y = y
GameFormDrawer.DrawImage1(CellBitmap.Value, CellRectangle.Value, BackdropRectangle.Value, False)
GameFormDrawer.Refresh2(BackdropRectangle.Value)
GameGameWindow.DrawBackgroundImage2(GameForm.Image)
End Sub
Thanks, fjsantos. |
|
||||
|
This is the same problem as this one: fullscreen problem
DrawBackgroundImage2 disposes the image after drawing it on the GameWindow. The solution is to create a new copy of the image (with a Bitmap object) and then pass it. It will be fixed in the next update of the Sprite library. BTW, why are you setting ForeLayer to true? It is hidden by the GameWindow. There is a problem with the designer code in your source file. You can use the attached file instead. |
|
|||
|
Hi all.
Yep i suppose that image was disposing after drawimage. The code was only a draft playing around with forms and gamewindows (I have to learn a lot yet!). Thanks a lot for improve the code!! Klaus thanks to you too for your interest and help!! Best Regards, fjsantos. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| i lost treeview.dll after loading V6 | dan kabestan | Questions & Help Needed | 1 | 01-03-2008 12:57 PM |
| Performance on Bitmap? | Roadrunner | Questions & Help Needed | 9 | 12-09-2007 03:19 PM |
| Background-Color on Bitmap.new2 | Roadrunner | Bug Reports | 1 | 12-08-2007 04:08 PM |
| Out of Memory error while loading bitmap | HARRY | Questions & Help Needed | 3 | 05-15-2007 01:12 PM |
| Image gets lost with orientation change | HARRY | Questions & Help Needed | 7 | 05-14-2007 10:19 AM |