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. »

- Page 2 -


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  
 



 
- Page 1 -


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  
 



 
- Page 2 -



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  
 



LineTo etc. is everything GDI ( [...]  ) -

are everything hochoptimierte functions The You well self (alike where with) not faster

program can. naturally can You a line too by DX draw but the

is Yes a complete others number like as if You a line by OpenGL

zeichest. with letzteren both Examples become You but too at least once a

line indicate must. look at The oglui [...]  velvet oglhelper.inc.

what now performant is depends severe taken To very of jeweiligen Anwendungs/

individual case ex and integrally blanket can not say the one with DX a

line faster on the screen get as with the GDI on my own already because of

the enormous Vorbereitungsmassnahmen The for DX or OGL necessary are

before one at all what draw can.
 
09/05/12  
 



Nachtrag: my not so faster computer draw so 100.000 lines in less than 1 second (953ms) :
CompileMarkSeparation

16 kB
Hochgeladen:09/05/12
Downloadcounter204
Download
 
09/05/12  
 




Andreas
Koch
That the pixels.inc and attachment I had already rausgefunden and in my Beispielcode supra installed. If I the right see, have I even The detour with createcompatibledc correctly. made. nevertheless malt the not correctly..

PS: DirectX hears itself of course too calm on, but hey people, to one year I had the word "Profan" yet never heard, so quick be I do not.
If me the what bring, make I the but too yet.
before wished I but really yet OpenGL ausloten. Perhaps reicht the for my needs from.
 
09/05/12  
 



i know of course not what very You to have but To "Trotzdem malt the not correctly.."
can I only say "Zeig time since, the Error lying where differently...".

Andreas cook (05.09.12)

but hey people, to one year I had the word "Profan" yet never heard, so quick be I do not.


Welcome!
 
09/05/12  
 




Andreas
Koch
I Have in my first Posting a Beispielcode, where on a Bitmap really a black line painted go ought to. The vermiss I somehow....
 
09/05/12  
 



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  
 




Andreas
Koch
OK, again what learnt. thanks, so can I go on.
 
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.723 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