Jump to content

milurt

Members
  • Content Count

    20
  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. milurt

    bitmap is not displayed

    mister anders melander, do you want to say, what is missed to be a valid GUI? kodezwerg has only made procedure for the createwindow-theme, that types are not my questions. this means no more procedures are to add to show the bitmap? i have no runtime error.
  2. milurt

    bitmap is not displayed

    but who can say the error in my program?
  3. milurt

    bitmap is not displayed

    now compile it: is there a procedure missed? why the picture is not to see in the window? </> program ForumBitmap2023; {$APPTYPE GUI} uses System.SysUtils,windows; Var winc:WNDCLASSEx; wname,wcl:PChar; wnddc:hdc; windbp,hwind:hwnd; PStrc:TPAINTSTRUCT; FH:THandle; FBuf,Bmpf:Pointer; fch:Pchar; F:File of byte; BmpH:HBitmap; Bmp:tagBitmap; BmpDC1:Hdc; bmpdc2:hdc; bmpdc3:hdc; Function wndproc(hwndow:HWND;msga,msgword:word;msglong:longint):LResult;stdcall; Begin wndproc:=DefWindowProc(hwndow,msga,msgword,msglong); End; Begin winc.cbSize:=sizeof(winc); winc.style:=CS_HREDRAW Or CS_VREDRAW; winc.lpfnWndProc:=Addr(wndproc); winc.cbclsExtra:=0; winc.cbWndExtra:=0; winc.hInstance:=0;; winc.hIcon:=LoadIcon(0, IDI_APPLICATION); winc.hCursor:=0; winc.hbrBackground:=(14 + 1); winc.lpszMenuName:=NiL; winc.lpszClassName:='Window'#0; winc.hIconSm:=LoadIcon(winc.hInstance, IDI_APPLICATION); RegisterClassEx(winc); wcl:='Program'#0; wname:='Window'#0; hwind:=CreateWindow(wname,wcl,WS_OVERLAPPED+WS_SIZEBOX,300,100,700, 500,0,0,0,NiL); ShowWindow(hwind,sw_show); UpdateWindow(hwind); wndDC:=GetDC(hwind); PStrc.hdc:=wndDC; PStrc.ferase:=false; PStrc.rcpaint.left:=0; PStrc.rcpaint.top:=0; PStrc.rcpaint.right:=690; PStrc.rcpaint.bottom:=495; windBP:=BeginPaint(hwind,PStrc); Bmpf:=GetMemory(1000000*2); fch:=bmpf; fch:=fch+10; FBuf:=fch; AsSign(F,'C:\Paints.bmp'); FH:=FileOpen('C:\Paints.bmp',fmOpenReadWrite); FileRead(FH,FBuf^,735829); bmp.bmtype:=0; bmp.bmwidth:=630; bmp.bmheight:=492; bmp.bmWidthBytes:=2*3*bmp.bmwidth; bmp.bmplanes:=1; bmp.bmbitspixel:=24; bmp.bmBits:=FBuf; BmpH:=CreateBitmapIndirect(bmp); bmpdc1:=getdc(bmph); selectobject(bmpdc2,Bmpdc1); BmpDC3:=CreateCompatibleDC(Bmpdc2); BitBlT(wnddc,30,10,620,489,BmpDC3,0,0,SRCCOPY); end. </>
  4. milurt

    bitmap is not displayed

    no tips anymore? why my program does not work.
  5. milurt

    bitmap is not displayed

    the paintstruct defines the area to paint, but after my set of bitmap-drawing procedure i see the window and other drawings but not the bitmap, which i want from tagbitmap place on beginpaint.
  6. milurt

    bitmap is not displayed

    i think it is better, if i do not write the complete registerclass and createwindow. than you have more overview. why is that the problem? and the second part of the program are the bitmap-drawing- procedures, where i asked which procedure can be absent. are the variables:=procedures better readable, if i make some spaces at the beginning of the line?
  7. milurt

    memory paging or segmentation

    no, suddenly, but the problem was a half year long.
  8. milurt

    bitmap is not displayed

    is a procedure missing or the sequence wrong? var B001:tagBitmap; HB:hbitmap; bitmap1-3:hdc; begin hwnd001:=createwindow; wdc:=getdc;hbp:=beginpaint; PB:=getmemory; B001.bmBits:=PB; HB:=CreateBitmapIndirect(B001); bitmapdc1:=getdc(HB); selectobject(bitmapdc2,bitmapdc1); bitmapdc3:=CreateCompatibleDC(bitmapdc2); bitblt(wdc,300,300,200,100,bitmapdc3,0,0,SRCCOPY); end.
  9. milurt

    memory paging or segmentation

    now my program works.
  10. milurt

    memory paging or segmentation

    i see nowhere sizeof(char) in my program. why is a +1 a +2? for does not change it and getmemory is done for 1x3000000, which was not so important, because i get the runtime error at each segm:0000 and segm:0001 where i write to not at 3000000+1
  11. milurt

    memory paging or segmentation

    now compile it: program Memorial; {$APPTYPE GUI} var ballpointer,step:pchar; a:NativeInt; Begin step:=ptr(1); ballpointer:=GetMemory(3000000); for a:=1 to 3000000 do begin ballpointer^:=#45; ballpointer:=ballpointer+1; end; end.
  12. milurt

    memory paging or segmentation

    but i get always the runtime error on ballnumber=segm:0000
  13. milurt

    memory paging or segmentation

    david heffernan, if it is so important, i wrote, that you can write for i:=1 to and i sayed the problem is segm:0000^=83; gave a runtime error. and i wanted to know about paging and segmentation. lars fosdal, i meant ballnumber^:=59 if ballnumber=each segm:0000 or segm:0001 gave the runtime error
  14. milurt

    memory paging or segmentation

    you want to say getmem gives a pointer to segm:0000, can you not write for i:=1 and accept that the problem is ballnumber:=59; if ballpointer=each segm:0000 or segm:0001
  15. milurt

    memory paging or segmentation

    i do not need efficience code. i have the problem that there is a runtime error at segm:0000 and segm:0001
×