English
Forum

XPSE: line on Bitmap draw

 
- Page 1 -



Andreas
Koch
Hello together,

there's time again trouble, with the I do not weiterkomme. It's all right therefore, drawing one Graphen on a Bitmap To speed. thereby goes it first once only circa together hängende lines what about me would the whole gladly with XPSE concern.
thereby stand I now to two Problemen.

1. XPSE knows only whom commands Setpixel, question: knows someone a API-commands, the one with a line draw can? Einstellungsmöglichkeiten of colour, Start- and Endpunkt as well as Linienstärke wären necessary.
2. XPSE draw fundamentally first once only on the Mainwindow. Can drawing somehow on a Bitmap redirecting?

To 1.: the can I me probably too yet self basteln, the API-commands would the whole only vereinfachen.

To 2. have I attempts, me something from the nProc drawhPicRotated To wander, what these function to have shining, works but not so integrally....
CompileMarkSeparation
 {$cleq}
 $I Pixels.Inc
Window 0,0 - %Maxx, %Maxy
var hPic&=create("hNewPic",400,400,$FF)
StartPaint hPic&
UseFont "Arial",30,0,1,0,0
textcolor $FFFF,-1
drawtext 5,0,"XProfan.Com"
textcolor $AA,-1
drawtext 5,0,"XProfan"
EndPaint
DrawPic hPic&,0,0,0

nproc Test

    Parameters hPic&
    long hDCBits=CreateCompatibleDC(hDC)
    selectObject(hDCBits, hPic&)

    WhileLoop 50

        SetPixel(hDCBits,50+&loop,50,0)

    EndWhile

EndProc

Test(hPic&)
DrawPic hPic&,500,0,0
WaitInput

would be lovely, if your me there help on could.

lovely Greeting

Andreas cook
 
09/05/12  
 



« this Posting watts as Solution marked. »

say we simply because there something "geschludert" watts.

(have The to put in the code markiert)
CompileMarkSeparation
 {$cleq}
Window 0,0 - %Maxx, %Maxy
var hPic&=create("hNewPic",400,400,$FF)
StartPaint hPic&
UseFont "Arial",30,0,1,0,0
textcolor $FFFF,-1
drawtext 5,0,"XProfan.Com"
textcolor $AA,-1
drawtext 5,0,"XProfan"
EndPaint
DrawPic hPic&,0,0;0// <-- statt DrawPic hPic&,0,0,0
Test(hPic&)
DrawPic hPic&,500,0;0// <-- statt DrawPic hPic&,500,0,0
WaitInput

nproc Test

    Parameters hPic&
    long hDCBits=CreateCompatibleDC(hDC)
    selectObject(hDCBits, hPic&)

    WhileLoop 50

        SetPixel(hDCBits,50+&loop,50,0)

    EndWhile

    deleteDC(hDCBits)// <-- vergessen, eigentlicher Knackpunkt

ENDPROC



5 kB
Hochgeladen:09/05/12
Downloadcounter110
Download
 
09/05/12  
 




Dieter
Zornow
I work fundamentally not XPSE, but XProfan has still The command Line and LineTo. circa on one Bitmap to drawing must You Startpaint lever and Endpaint use.
 
XProfan X2
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
09/05/12  
 




Andreas
Koch
thanks. but the known I already. It's all right therefore, that with the whom Profan command too long lasts what about me the whole with XPSE speed would like.
 
09/05/12  
 




funkheld
Hello, I had such a thing already time with XPIA made, there are too some Examples drin. XPSE and XPIA can indeed together used go.
I had then none grossen Geschwindigkeitsunterschied check can, because the graphic-windows-command(API-commands ) too with XPIA(ASM) used go.
the only what speed becomes are under umständen creep and Zählvariablen , these Time becomes but again by the graphic-windows-command(API-commands ) verschlampt.

except You write now self one Linienprogramm etc., there must You then but again The spots yourself calculate with ASM, namely if You for again whom Plotbefehl(API-commands ) take , goes The Zeitschlamperei again go.



I work fundamentally not XPSE, but XProfan has still The command Line and LineTo. circa on one Bitmap to drawing must You Startpaint lever and Endpaint use.


without XPSE or XPIA is the entire Profanprogramm grottenlangsam.

look here times for XPIA : [...] 
the only what there tall geschleunigt becomes is the Zählschleife.

greeting
 
09/05/12  
 




funkheld


then bliebe there yet the Umlenken the Zeichenbefehle on a Bitmap....


You need The Anfangsadresse the Bitmap The You Change want, wide, Höhe and Bitmaptiefe, then can you loslegen with XPIA.

greeting
 
09/05/12  
 




Andreas
Koch
Sorry for the verfrühte Posting. I had whom Link to the example not seen.
i think, so can I what begin. though sustain I always The Error Message, that it GetXpiaProcAddress not knows. Do I for yet something take on?
CompileMarkSeparation
 $MAKE CLE
 $H Windows.ph
Declare hwin&,x&,y&,f&,hdcwin&
Window 20,20-200,200
hWin& = Create("Window", %hWnd, "Test", 250, 20, 650,500)
hDCWin& = ~GetWindowDC(hWin&)

If 0

    AsmStart pset

        Parameters hdcwin&,x&,y&,f&
        mov ecx,para1
        mov eax,para2
        mov ebx,para3
        mov edi,para4
        invoke SetPixel,ecx,eax,ebx,edi

    AsmEnd

EndIf

whileloop 0,100,1

    x&=&loop
    y&=&loop
    f&=$ff0000
    Call(GetXpiaProcAddress(XpiaModule&,"pset"),hdcwin&,x&,y&,f&)

endwhile

WaitInput
End
 
09/05/12  
 




funkheld


GetXpiaProcAddress


I faith the Aufrufname has changed ?

but "Setpixel" uses again these slow WindowsAPI.

greeting
 
09/05/12  
 



what power your because here?! everything plenty plainer!

One rectangle: [...] 

On hWnd characters simply so:
CompileMarkSeparation
nProc test

    rectangle(hDC,10,10,100,100)

endpro

line or Kurven desired? then simply lines or Kurvenfunktionen benefit!

any described and simply aufzurufen:
[...] 

thereafter goes ne line of 20,30 to 100,100 so:
CompileMarkSeparation
nProc Test

    MoveToEx(hDC,20,30,0)
    LineTo(hDC,100,100)

endproc


In nProcs stand quasi any APIs ready -

there can it one Yes on garnichts are missing.

Einzelnes Pixel settle?
CompileMarkSeparation
nProc Test

    setPixel(hDC,10,20,rgb(50,60,70))
    ...
 
09/05/12  
 




Andreas
Koch
the sees now so from, as could I the directly using. lovely Thanks already time.

i want but really only very ungern on the Mainwindow malen, really none. Can not somehow redirecting? I have there this hdc in the suspicion, white but not really something so to begin, see first Posting.

PS: what means the DC really in long?
 
09/05/12  
 



DeviceContext ( [...]  )

You can very so well on one "HPIC" malen -

the went then z.B. so:
CompileMarkSeparation
nProc test

    parameters aufDiesemHPic&//siehe create("hNewPic",... in XProfan-Hilfe
    var dc&=createCompatibleDC(hDC)// hDC ist von XProfan, siehe XProfan-Hilfe
    selectObject(dc&, aufDiesemHPic&)
    //rummalen

    whileLoop 1000

        setPixel(dc&,rnd(100),rnd(100),rnd($FFFFFF))

    wend

    //dc wieder entfernen da nicht mehr notwendig
    deleteDC(dc&)
    //fertig auf hPic rumgemalt

09/05/12  
 



Nachtrag: Gib too ne pixels.inc [...]  for Examples faster graphic- effects

and a hPic.inc too for fortgeschrittenes Rumbildereihen: [...] 

and look too time here mere: [...] 
 
09/05/12  
 




funkheld
Hmm.., what you mean are so again The slow internen graphic-Windowsbefehle(API):
MoveToEx(hDC,20,30,0)
LineTo(hDC,100,100)
for a slippy graphic taugen The nothing.

It's all right still directly plenty faster with (DirectX) and/or with XPIA(ASM) without these finished slow Move and LineTo.

greeting
 
09/05/12  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

15.745 Views

Untitledvor 0 min.
Rainer Hoefs05/03/19
Walter Köhler09/21/18
Andreas Koch09/08/15
iF04/12/15
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie