Mirage Source
http://web.miragesource.net/forums/

Blt to another window
http://web.miragesource.net/forums/viewtopic.php?f=201&t=1221
Page 1 of 20

Author:  Tosuxo [ Tue Jan 23, 2007 7:02 pm ]
Post subject:  Blt to another window

Ok, for my game, Monster Trainer, I'm changing from using picboxes to blting the monsters in the battle window... I've hit a snag... that I don't know how exactly to blt to another form's picbox haha

Could anyone give me any pointers?

I'm not very good with bitblt, if you didn't guess haha.

Cheers.

Author:  Robin [ Tue Jan 23, 2007 8:58 pm ]
Post subject: 

Have fun having 2 backbuffers.

Become a real man and only use one form.

Author:  Misunderstood [ Tue Jan 23, 2007 9:51 pm ]
Post subject: 

You can use blttohdc from a surface. Or create a new clip like what MS does for the main pic box.

Author:  Robin [ Tue Jan 23, 2007 10:10 pm ]
Post subject: 

Won't that blt the same thing?

He wants to blt two different things.

Author:  Tosuxo [ Tue Jan 23, 2007 11:36 pm ]
Post subject: 

my problem is i have a battle window already set up, i can't be arsed transfering it to mirage.frm 'cos it wouldn't look right

i'll try blttohdc... cheers for the replies :)

Author:  Tosuxo [ Wed Jan 24, 2007 1:31 pm ]
Post subject: 

Ok, i'm really confused now haha, right.. so i'm using Bitblt to do it with, i'm using the following code:
Code:
Call BitBlt(frmBattleWindow.picScreen.hdc, M1X, M1Y, 127, 127, frmGFX.picMonsters.hdc, 0, 0, vbSrcCopy)


but this happens:
Image

it like... draws the map below...

anyone have any ideas? :S

Edit: sorted that

Now I have come accross the problem of that bitblt won't let me have black transparent... I need a specific colour to be transparent... can someone please give me pointers to a way I can blt stuff into a picbox... even if i need to make 2 backbuffers and stuff and make 1 backbuffer for the main game window, and the 2nd for the battle window

i hate blting lol

cheers :)

Author:  Tosuxo [ Wed Jan 24, 2007 2:37 pm ]
Post subject: 

ok, this may help, here's the code I've used up to now (except the dims, saving time):

InitDirectX
Code:
Sub InitDirectX()

    ' Initialize direct draw
    Set DD = DX.DirectDrawCreate("")
    Set DD2 = DX.DirectDrawCreate("")
    frmMirage.Show
   
    ' Indicate windows mode application
    Call DD.SetCooperativeLevel(frmMirage.hWnd, DDSCL_NORMAL)
    Call DD2.SetCooperativeLevel(frmBattleWindow.hWnd, DDSCL_NORMAL)
   
    ' Init type and get the primary surface
    DDSD_Primary.lFlags = DDSD_CAPS
    DDSD_Primary.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE
    Set DD_PrimarySurf = DD.CreateSurface(DDSD_Primary)
   
    'Monster One
    DDSD2_Primary.lFlags = DDSD_CAPS
    DDSD2_Primary.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE
    Set DD2_PrimarySurf = DD2.CreateSurface(DDSD2_Primary)
   
    ' Create the clipper
    Set DD_Clip = DD.CreateClipper(0)
    Set DD2_Clip = DD2.CreateClipper(0)
   
    ' Associate the picture hwnd with the clipper
    DD_Clip.SetHWnd frmMirage.picScreen.hWnd
    DD2_Clip.SetHWnd frmBattleWindow.picScreen.hWnd
       
    ' Have the blits to the screen clipped to the picture box
    DD_PrimarySurf.SetClipper DD_Clip
    DD2_PrimarySurf.SetClipper DD2_Clip
       
    ' Initialize all surfaces
    Call InitSurfaces
    Call InitSurfaces2
End Sub



Initsurfaces2
Code:
Sub InitSurfaces2()
Dim Key As DDCOLORKEY
    If FileExist("/GFX/monsters/monsters.bmp") = False Then
        Call MsgBox("Your Monster graphics are not available, please download the game again.", vbCritical, "Graphics Error!")
        Call GameDestroy
    End If
   
    Key.low = 0
    Key.high = 0
   
    ' Initialize MONSTER back buffer
    DDSD2_BackBuffer.lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH
    DDSD2_BackBuffer.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
    DDSD2_BackBuffer.lWidth = frmbattlewindow.picscreen.width
    DDSD2_BackBuffer.lHeight = frmbattlewindow.picscreen.height
    Set DD2_BackBuffer = DD2.CreateSurface(DDSD2_BackBuffer)
   
    ' Init Monsters ddsd type and load the bitmap
    DDSD2_MONSTERS.lFlags = DDSD_CAPS
    DDSD2_MONSTERS.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
    Set DD2_MONSTERSsurf = DD2.CreateSurfaceFromFile(App.Path & "\GFX\monsters\monsters.bmp", DDSD2_MONSTERS)
    DD2_MONSTERSsurf.SetColorKey DDCKEY_SRCBLT, Key

End Sub


Now the jumbled up bit, a sub that's called when battle window is open, containing these things:
Code:

        'Rec Place
        rec2.top = 0
        rec2.Bottom = 127
        rec2.Left = 0
        rec2.Right = 127
       
    M1X = 100
    M1Y = 100
    Call DD2_BackBuffer.BltFast(M1X, M1Y, DD2_MONSTERSsurf, rec2, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

TexthDC = DD2_BackBuffer.GetDC
        rec2.top = 0
        rec2.Bottom = rec2.top + frmBattleWindow.picScreen.Height
        rec2.Left = 0
        rec2.Right = rec2.Right + frmBattleWindow.picScreen.Width
        ' Release DC
        Call DD2_BackBuffer.ReleaseDC(TexthDC)
               
        ' Get the rect to blit to
        Call DX2.GetWindowRect(frmBattleWindow.picScreen.hWnd, rec_pos2)
        rec_pos2.Bottom = rec_pos2.top + frmBattleWindow.picScreen.Height
        rec_pos2.Right = rec_pos2.Left + frmBattleWindow.picScreen.Width
       
        ' Blit the backbuffer
        Call DD2_PrimarySurf.Blt(rec_pos2, DD2_BackBuffer, rec2, DDBLT_WAIT)



Anyone see any problems? :S[/code]

Author:  Tosuxo [ Thu Feb 01, 2007 9:10 pm ]
Post subject: 

I still ain't got this to work, but in all honesty I haven't had much time, essay due in tomorrow and had 2 tests this week... been really busy

can anyone give me any pointers? cheers

Author:  Tosuxo [ Sun Feb 04, 2007 6:21 pm ]
Post subject: 

I've had a thought... would there be a way to use the bitblt sub to draw it but WITH transparent black?

I don't know much about bitblt so I can't really say I know how to, could anyone please give me some pointers?

Author:  wanai [ Wed Dec 01, 2021 1:44 pm ]
Post subject:  Re: Blt to another window

инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоsemiasphalticflux.ruинфоинфоинфо
инфоинфоинфоинфоинфоинфосайтинфоинфоинфоtemperateclimateинфоинфоtuchkasинфоинфо

Author:  wanai [ Tue Feb 01, 2022 7:29 pm ]
Post subject:  Re: Blt to another window

part279.7CHAPCHAPBillHenrRobeFranDanyBrenThomTescLuciSempMichDomiOmegpottMetaUnitZoneJeweRond
GarlPeteCuisCurvSilvEdwaDomaSomeraggHugoNephViagHopkPerfAccaOreaDoveNiveWolfFredlinePantAnat
WynoXVIIPushSonaMutaJoacLycrSonaWojcMicrElizAdioBrasVentCircSelaLighwwweElegmattGaviRichJoli
AlleFredVentNikiElegOsirDalyRondSpliELEGSwarZonePaliHansDuffNasoZoneKingZoneRusiLeigZoneTade
GordZoneZafiZoneJeweZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneAlfrZonediamZoneZoneHaroZoneZone
ZoneJonaMarqKOSSpachNardMabeFrosWaltCotoKRATMyMyGlamJeffWengSponVinuSTARSeinCERAFilmDjVuBlue
CleaBrigqTreCollZongCarsBabyWoulPoweMistGiotValeViteChouEukaFantJordReveWindhorrAgatCeleDwig
DesaClayMickWillHeinAcadCorpWaltSerpCraiMichIDEFSorrOasiTuskCamaVasiPhilKathWorlJoshMichXVII
WindMastfashEnglOichOrbiexplErikPhilFranMeattitlYounGonnQuikSpenAndyCombEricSusadateKOSSKOSS
KOSSMaryOZONBuddwwwnCrasEmilEasyRobeMissChriEnglRobetuchkasDharChoc

Author:  wanai [ Tue Mar 01, 2022 8:07 pm ]
Post subject:  Re: Blt to another window

http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruинфоhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruhttp://semiasphalticflux.ruhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.ruhttp://taskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruhttp://temperateclimate.ruhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru

Author:  wanai [ Fri May 13, 2022 8:06 am ]
Post subject:  Re: Blt to another window

Vass

Author:  wanai [ Fri May 13, 2022 8:07 am ]
Post subject:  Re: Blt to another window

293.5

Author:  wanai [ Fri May 13, 2022 8:08 am ]
Post subject:  Re: Blt to another window

Duke

Author:  wanai [ Fri May 13, 2022 8:09 am ]
Post subject:  Re: Blt to another window

Repr

Author:  wanai [ Fri May 13, 2022 8:11 am ]
Post subject:  Re: Blt to another window

Sanz

Author:  wanai [ Fri May 13, 2022 8:12 am ]
Post subject:  Re: Blt to another window

Mika

Author:  wanai [ Fri May 13, 2022 8:13 am ]
Post subject:  Re: Blt to another window

Pons

Author:  wanai [ Fri May 13, 2022 8:14 am ]
Post subject:  Re: Blt to another window

Mich

Author:  wanai [ Fri May 13, 2022 8:15 am ]
Post subject:  Re: Blt to another window

Rajn

Author:  wanai [ Fri May 13, 2022 8:16 am ]
Post subject:  Re: Blt to another window

Bert

Author:  wanai [ Fri May 13, 2022 8:17 am ]
Post subject:  Re: Blt to another window

Harr

Author:  wanai [ Fri May 13, 2022 8:18 am ]
Post subject:  Re: Blt to another window

Zyli

Author:  wanai [ Fri May 13, 2022 8:19 am ]
Post subject:  Re: Blt to another window

Sidn

Page 1 of 20 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/