Readfile ... Save Binary Data

Hi All

Possible To Get Data From Scanner By ReadFile Function When Scanner Start Then Save And Load In Image Control ?

1 Like

HI @gerailly ,

To properly answer your question we really need a bit more information to work with. Please try to provide use with your goals, what you’ve already tried and how (approximately) you want to achieve your goal.

2 Likes

I Want To CreateDc Then Connect To Scanner And Preview Scan On DC Like Scanner Device … EveryBody Can Dc In Screen And Load Bitmap File Into

Hi

CreateDc Then Connect To Scanner And Show Scan Into Dc … Example SomeBody Create Dc In Screen And Load Bitmap File Into.

We really need more information to work with. At the minimum, provide:

  • What programming languages and/or techniques (frameworks, etc.) are involved?
  • What are you trying to achieve?
  • What have you already tried to do?
  • Where  exactly lies the problem in your code
  • Some example code or a repository
1 Like

Can you please point out  where exactly you are having trouble with your code, and post your code in a way that makes it easier to read?

Also, could you please tell us if this article (https://www.w3schools.com/tags/av_prop_duration.asp) answers your question? It seems to cover what you are trying to achieve.

Several people have written samples of talking to a scanner in Windows. For example.

If your confusion is regarding the display of an image on the screen, in Winforms the easiest way to do it is via a PictureBox.

Using CreateDC to draw to the screen is incorrect: you want to use GetDC.

2 Likes

Ah, I’m sorry - I see my last post was placed in a wrong topic.

Did the helpful advice from @fire-eggs help you out? If so, you should mark his post as a solution.

Unfortunately I Work On Ms-Access And No Have PictureBox And Property hwnd … So I Cannot Connect To Scanner So That Display Peview In DC … Example EveryBody Can LoadImage In Display

Dim hDC
Dim rcBmp As RECT
hDC=GetDC(0)
GetClientRect hDC,rcBmp
hBitmap=CreateCompatibleDC(hDC)
SelectObject hDC,GetStockObject(BRUSH_PEN)
Rectangle hdc,100,200,200,400
BitBlt hDC,…
??? When Scan The Document … Possible To Load into DC Not Save

What you need to do is get the window handle (hWnd) of the control you wish to draw to. Once you have the hWnd, you can call GetDC() to get a device context.

Possible relevant links: here here here here

Unfortunately I CouldNot Rotate Text To PrintPreview Of Access Report With GetDc ,CreateFontIndirect,TexoutA Just Send To Screen Not PrintPreview So That I Can Able To See Rotate Text In Print Event Of Detail … Because In Access Report Just Detail Have Print 's event … Here Maybe Somebody Try Copy RotateText To PrintPreview , Maybe I m Wrong And Cannot Do it … Even I Wanted To Change Color Of IDOK In MsgboxHook But It Is Impossible Because WM_PAINT Or WM_CREATE Not Working Here … In This Next Problem Can Create Rectangle In x,y Position Of IDOK In Msgbox (#32770) But It Copy To Behinde It Not in I Think Static Area .