Jump to content

milurt

Members
  • Content Count

    34
  • 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

    kodezwerg: citate: you said nothing to mine you citated me: pointer^:=rgb , that was i sayed to your code and what i want to do, the pointer^ should drawn in a window x,y how you call it in non-vcl i need not only a hbitmap, but a pointer, if the window-procedures need some handles. converted remy lebeau without the libraries, drawing no bitmap even bitblt is true.
  2. milurt

    bitmap is not displayed

    sysinit: he says it is redeclared and has 6 compiler-errors
  3. milurt

    bitmap is not displayed

    and kodezwerg: my question was pointer^:=rgb;
  4. milurt

    bitmap is not displayed

    last example of remy lebau: my embarcadero could not find System.SysInit but the other both libraries.
  5. milurt

    bitmap is not displayed

    but even than there is this runtime error with the cpu-window in my embarcadero 10.4 for windows 10 64-bit WinOpen; PaintOpen; while GetMessage(msg, 0, 0, 0) do begin TranslateMessage(msg); DispatchMessage(msg); end; Repeat Until GetAsyncKeyState(32)=-32768; End.
  6. milurt

    bitmap is not displayed

    and improved the main with this winopen gives a runtime error with opening the cpu-window: Begin FMem:=GetMemory(1000000); AsSign(F,'D:\15333842.bmp'); FH:=FileOpen('D:\15333842.bmp',fmOpenReadWrite); FR:=FileRead(FH,FMem^,909594{FileSize(F)}); Longint(BMem):=longint(FMem)+Longint(Pointer(longint(FMem)+10)^); PicWidth:=LongInt(Pointer(longint(FMem)+18)^); PicHeight:=LongInt(Pointer(longint(FMem)+22)^); WinWidth:=PicWidth+20;WinHeight:=PicHeight+20; WinX:=(1920-WinWidth) Div 2;WinY:=(1080-WinHeight) Div 2; WinOpen; PaintOpen; Repeat Until GetAsyncKeyState(32)=-32768; end.
  7. milurt

    bitmap is not displayed

    and with WCls1.lpfnWndProc:=Addr(wndproc); it is not working too
  8. milurt

    bitmap is not displayed

    with the wndproc the program works not better: i can see no window anymore program BmpToWinWP; {$APPTYPE GUI} uses WinProcs,System.SysUtils; var FMem:Pointer; FH:THandle; F:File of Byte; FR:LongInt; BMem:Pointer; PicWidth,PicHeight:Integer; WinX,WinY,WinWidth,WinHeight, HWnd1:HWND; WCls1:WndClassEx; WinDC:HDC; PS:TPaintStruct; WinBP:HDC; PB:Boolean; BmpH:HBitmap; CDC:HDC; SelO:HGDIObj; BmpT:tagBitmap; Procedure WinOpen; Var WCN,WT:PChar; WReg:Integer; WH1:HWnd; Begin WCls1.cbSize:=sizeof(WCls1); WCls1.style:=CS_HREDRAW Or CS_VREDRAW; WCls1.lpfnWndProc:=Addr(DefWindowProc); WCls1.cbclsExtra:=0; WCls1.cbWndExtra:=0; WCls1.hInstance:=GetModuleHandle(nil);; WCls1.hIcon:=winprocs.LoadIcon(0, IDI_APPLICATION); WCls1.hCursor:=0; WCls1.hbrBackground:=(14 + 1); WCls1.lpszMenuName:=NiL; WCls1.lpszClassName:='My Window'#0; WCls1.hIconSm:=LoadIcon(WCls1.hInstance, IDI_APPLICATION); WReg:=WinProcs.RegisterClassEx(WCls1); WT:='My Program'#0; WCN:='My Window'#0; HWnd1:=WinProcs.CreateWindow(WCN,WT, {{} ws_popup+ws_tabstop, {NoFrame,NoTitle,NoMenu,NoMove,NoTabStop,00XY00} {{ WS_OVERLAPPED+WS_SIZEBOX+WS_TABSTOP, {ThickFrame,Title,NoMenu,NoMove,NoTabStop,ThanXY00} WinX,WinY,WinWidth,WinHeight, 0,0,GetModuleHandle(NiL),NiL); ShowWindow(HWnd1,sw_show); UpdateWindow(HWnd1); End; Procedure PaintOpen; Begin WinDC:=WinProcs.GetDC(HWnd1); {device context of window} PS.hdc:=WinDC; PS.ferase:=false; PS.rcpaint.left:=WinX; PS.rcpaint.top:=WinY; PS.rcpaint.right:=WinWidth; PS.rcpaint.bottom:=WinHeight; WinBP:=WinProcs.BeginPaint(HWnd1,PS); End; Procedure PaintRect(RX,RY,RWidth,RHeight:Integer;R,G,B:Byte); Var R1:TRect;B1:HBrush; Begin R1.left:=RX; R1.right:=RX+RWidth; R1.top:=RY; R1.bottom:=RY+RHeight; B1:=CreateSolidBrush(((B*256)+G)*256+R); fillrect(WinDC,r1,b1); DeleteObject(B1); End; procedure wndproc(hwnd:hwnd;msg,pw:word;pl:longint); begin case msg of wm_paint:begin WinWidth:=PicWidth+20;WinHeight:=PicHeight+20; WinX:=(1920-WinWidth) Div 2;WinY:=(1080-WinHeight) Div 2; WinOpen; PaintOpen; PaintRect(0,0,WinWidth,WinHeight,0,200,0); PaintRect(10,10,PicWidth,PicHeight,200,0,0); BmpT.bmtype:=0; BmpT.bmwidth:=PicWidth; BmpT.bmheight:=PicHeight; BmpT.bmWidthBytes:=2*BmpT.bmwidth; BmpT.bmplanes:=1; BmpT.bmbitspixel:=24; BmpT.bmBits:=BMem; BmpH:=CreateBitmap(PicWidth,PicHeight,1,24,BMem); CDC:=CreateCompatibleDC(WinDC); SelO:=SelectObject(CDC,BmpH); getobject(BmpH,sizeof(bmpT),Addr(bmpT)); PB:=BitBlT(WinDC,00,00,PicWidth,PicHeight,CDC,00,00,SRCCopy); SelectObject(CDC,SelO); DeleteObject(CDC); end; end; end; Begin FMem:=GetMemory(1000000); AsSign(F,'D:\15333842.bmp'); FH:=FileOpen('D:\15333842.bmp',fmOpenReadWrite); FR:=FileRead(FH,FMem^,909594{FileSize(F)}); Longint(BMem):=longint(FMem)+Longint(Pointer(longint(FMem)+10)^); PicWidth:=LongInt(Pointer(longint(FMem)+18)^); PicHeight:=LongInt(Pointer(longint(FMem)+22)^); Repeat Until GetAsyncKeyState(32)=-32768; end.
  9. milurt

    bitmap is not displayed

    now i have this and i can not see the picture: program BitmapToWindow; {$APPTYPE GUI} uses WinProcs,System.SysUtils; var FMem:Pointer; FH:THandle; F:File of Byte; FR:LongInt; BMem:Pointer; PicWidth,PicHeight:Integer; WinX,WinY,WinWidth,WinHeight, HWnd1:HWND; WCls1:WndClassEx; WinDC:HDC; PS:TPaintStruct; WinBP:HDC; PB:Boolean; BmpH:HBitmap; CDC:HDC; SelO:HGDIObj; BmpT:tagBitmap; Procedure WinOpen; Var WCN,WT:PChar; WReg:Integer; WH1:HWnd; Begin WCls1.cbSize:=sizeof(WCls1); WCls1.style:=CS_HREDRAW Or CS_VREDRAW; WCls1.lpfnWndProc:=Addr(DefWindowProc); WCls1.cbclsExtra:=0; WCls1.cbWndExtra:=0; WCls1.hInstance:=GetModuleHandle(nil);; WCls1.hIcon:=winprocs.LoadIcon(0, IDI_APPLICATION); WCls1.hCursor:=0; WCls1.hbrBackground:=(14 + 1); WCls1.lpszMenuName:=NiL; WCls1.lpszClassName:='My Window'#0; WCls1.hIconSm:=LoadIcon(WCls1.hInstance, IDI_APPLICATION); WReg:=WinProcs.RegisterClassEx(WCls1); WT:='My Program'#0; WCN:='My Window'#0; HWnd1:=WinProcs.CreateWindow(WCN,WT, WS_OVERLAPPED+WS_SIZEBOX+WS_TABSTOP, WinX,WinY,WinWidth,WinHeight, 0,0,GetModuleHandle(NiL),NiL); ShowWindow(HWnd1,sw_show); UpdateWindow(HWnd1); End; Procedure PaintOpen; Begin WinDC:=WinProcs.GetDC(HWnd1); PS.hdc:=WinDC; PS.ferase:=false; PS.rcpaint.left:=WinX; PS.rcpaint.top:=WinY; PS.rcpaint.right:=WinWidth; PS.rcpaint.bottom:=WinHeight; WinBP:=WinProcs.BeginPaint(HWnd1,PS); End; Procedure PaintRect(RX,RY,RWidth,RHeight:Integer;R,G,B:Byte); Var R1:TRect;B1:HBrush; Begin R1.left:=RX; R1.right:=RX+RWidth; R1.top:=RY; R1.bottom:=RY+RHeight; B1:=CreateSolidBrush(((B*256)+G)*256+R); fillrect(WinDC,r1,b1); DeleteObject(B1); End; Begin FMem:=GetMemory(1000000); AsSign(F,'D:\15333842.bmp'); FH:=FileOpen('D:\15333842.bmp',fmOpenReadWrite); FR:=FileRead(FH,FMem^,909594{FileSize(F)}); Longint(BMem):=longint(FMem)+Longint(Pointer(longint(FMem)+10)^); PicWidth:=LongInt(Pointer(longint(FMem)+18)^); PicHeight:=LongInt(Pointer(longint(FMem)+22)^); WinWidth:=PicWidth+20;WinHeight:=PicHeight+20; WinX:=(1920-WinWidth) Div 2;WinY:=(1080-WinHeight) Div 2; WinOpen; PaintOpen; PaintRect(0,0,WinWidth,WinHeight,0,200,0); BmpT.bmtype:=0; BmpT.bmwidth:=PicWidth; BmpT.bmheight:=PicHeight; BmpT.bmWidthBytes:=2*BmpT.bmwidth; BmpT.bmplanes:=1; BmpT.bmbitspixel:=24; BmpT.bmBits:=BMem; BmpH:=CreateBitmap(PicWidth,PicHeight,1,24,BMem); CDC:=CreateCompatibleDC(WinDC); SelO:=SelectObject(CDC,BmpH); getobject(BmpH,sizeof(bmpT),Addr(bmpT)); PB:=BitBlT(WinDC,00,00,PicWidth,PicHeight,CDC,00,00,SRCCopy); SelectObject(CDC,SelO); DeleteObject(CDC); Repeat Until GetAsyncKeyState(32)=-32768; end.
  10. milurt

    bitmap is not displayed

    that before has not worked
  11. milurt

    bitmap is not displayed

    hdcBmp := CreateCompatibleDC(PS.hdc); hOldBmp := SelectObject(hdcBmp, hBmp); BitBlt(PS.hdc, 30, 10, 620, 489, hdcBmp, 0, 0, SRCCOPY); SelectObject(hdcBmp, hOldBmp); DeleteDC(hdcBmp);
  12. milurt

    bitmap is not displayed

    that i don't have inserted
  13. milurt

    bitmap is not displayed

    now i have this and it is still nothing to see, but b=True bmpw:tagbitmap; hbmp:=CreateBitmap(100,100,1,24,RGBMem); bc:=CreateCompatibleDC(winddc); boss:=SelectObject(bc,hbmp); ???: getobject(hbmp,sizeof(bmpw),Addr(bmpw)); b:=bitblt(winddc,0,0,620,489,bc,0,0,SRCCOPY); SelectObject(bc,boss); DeleteObject(bc);
  14. 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.
×