Mirage Source
Simple BitBlt Question - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Simple BitBlt Question (/showthread.php?tid=392)



Simple BitBlt Question - halla - 28-10-2006

Ok im working on the Item Editor part of my program I have it all working except showing the image of the item. I know how to blt a picbox but thats it.

So I just want to know all the code I need to have it blt the item image. I have the form from in the game so names are the same. I tried doing it the same way but it doesnt work. Plus I added DirectX mod but looks like a lot of stuff I dont need for this.

Could someone just post the code I need for it to open the items.bmp file and display the image of the item number selected.

THanks a lot.


- Robin - 28-10-2006

picItem.picture = loadpicture(picture path)
picItem.top = (item * 32) * -1

?

-Kite-


- Misunderstood - 28-10-2006

That code is already in mirage. Its used to blt the item picture and the npc picture etc. Just look at that.


- halla - 28-10-2006

Misunderstood Wrote:That code is already in mirage. Its used to blt the item picture and the npc picture etc. Just look at that.

I did I took the code from mirage... the directx mod... everything that I can see that I need... and it runs fine but it doesnt show any picture its just black.


- Misunderstood - 28-10-2006

The code I'm referring to doesn't even involve anything that is in the directx mod.

I'm talking about what is used to blt the item picture and npc picture in their editors.


- halla - 28-10-2006

BitBlt?

I have that too if you mean that.

Also I just want the code it would take to do that... so while adding it I can learn also.

I can blt to a picbox like I did in my snake game... but I just have the images there and then it blts them if needed. Its not getting something from a file or whatever.


- Misunderstood - 28-10-2006

What do you have for bltblt exactly?


- halla - 28-10-2006

Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

Private Sub tmrPic_Timer()
BitBlt picPic.hDC, 0, 0, 32, 32, picItems.hDC, 0, 0, vbSrcCopy
End Sub

I just have 0's instead of the scrollbar value just to test getting it to show anything.


- Misunderstood - 28-10-2006

Well then you don't have all code from MS.
Look at how MS actually gets the gfx in picItems...its called around when the form loads....

Now the way ms does it isn't ideal, or even a decent way, imo, but it works.


- halla - 28-10-2006

I figured it out. I looked up a bitblt tutorial.

I think the problem was that it wasnt loading the the image right. I got that working on the form load and setting it. Then I had the other part right pretty much. A lot easier now I understand it.

Thanks for trying to help though.