LCDInfo.com

http://www.lcdinfo.com
It is currently Mon Nov 25, 2024 22:58

All times are UTC + 2 hours




Post new topic Reply to topic  [ 163 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 11  Next
Author Message
 Post subject:
PostPosted: Thu Feb 20, 2003 23:47 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
I believe that reading the data pixel at a time is the slowest part in that. At least it was in C++ Builder. Do you know if there is any way to get straight access to the data ?

Are you sure that there is a delay or if the writing is just so slow ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 0:42 
Offline

Joined: Fri Feb 07, 2003 16:37
Posts: 60
Location: SaNT QUiRZe, ||*|| CaTaLoNiA ||*||
Is the writing that is slow.

At this time, the function reads the pixels from a picturebox, i think that this is the problem slow writing.

I will try to implement a function that reads bytes from an array, but I don't know how to "transform" the pixel in a byte. I hope you can help me.

Thanks.

_________________
Nuestra única limitación es la imaginación


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 5:55 
Hi Marc

Quote:
but I don't know how to "transform" the pixel in a byte. I hope you can help me


Sorry for my poor english, i'am German

I hope i can help you. Please check this

Code:
Public Function PixelToHex(cntrl As Control, xoff As Long, yoff As Long, Width As Long, Height As Long) As String

Dim B() As Byte
Dim hdc As Long
Dim xi As Long
Dim exp As Long
Dim x As Long
Dim Y As Long
Dim cnt As Long
Dim pix As Long
Dim hx$
Dim hexx$

    ' die Breite, width, wird hier in Pixel angegeben, nicht in Byte.

    ReDim B(Width * Height)
    hdc = cntrl.hdc
    cnt = 0

    For Y = 0 To Height - 1
        For x = 0 To Width - 1 Step 8
            cnt = cnt + 1
            For xi = 0 To 7
                'pix = GetPixel(hdc, xoff + x + xi, yoff + y)
                pix = cntrl.Point(xoff + x + xi, yoff + Y)
                If pix = 0 Then
                    exp = 7 - xi
                    B(cnt) = B(cnt) Or 2 ^ exp
                End If
            Next xi
        Next x
    Next Y

   'Bis hierhin in Byte
   'Nun nach Hex Konvertieren
   
   For x = 1 To cnt
        hx$ = Hex$(B(x))
        If Len(hx$) = 1 Then
            hx$ = "0" + hx$
        End If
        hexx$ = hexx$ + hx$
    Next x
    PixelToHex = hexx$

End Function


I hope that is what you will

Run the code with fellow Function
Code:
Dim H$

    H$ = PixelToHex(Picture1, 0, 0, 240, 128)



You can translate it for your work! when you not will use "HEX"

Greetings Emil
PS: I hope you can help me out with your MODUL of T6963C


Top
  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 5:58 
Offline

Joined: Fri Feb 21, 2003 5:41
Posts: 43
delete


Last edited by Emil Weiss on Mon Feb 24, 2003 14:44, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 11:34 
Offline

Joined: Fri Feb 07, 2003 16:37
Posts: 60
Location: SaNT QUiRZe, ||*|| CaTaLoNiA ||*||
A lot of thanks Emil :D :D :D :D

This night i will try your code, and tomorrow i will post the results, thank you very much.

Bye !

_________________
Nuestra única limitación es la imaginación


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 12:00 
Hi Marc

Marc wrote:
A lot of thanks Emil :D :D :D :D

This night i will try your code, and tomorrow i will post the results, thank you very much.

Bye !


Please can send me, when finished and it work that Modul from your project?

Greetings Emil


Top
  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 13:29 
Offline

Joined: Fri Feb 07, 2003 16:37
Posts: 60
Location: SaNT QUiRZe, ||*|| CaTaLoNiA ||*||
Ok! When I have it, i will post it.

But what do you want ??? The function that you have send is in Visual Basic yet.

I don't understand what do you want, tell me it, and i will post it this night.

Thanks

_________________
Nuestra única limitación es la imaginación


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 19:47 
HI Marc

I'am working on a Prog in german.. for T6963C

Yes.. please send my the routines for VB with the *.bas Modul

Image

Image
Image
Image

Greetings Emil


Top
  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 19:52 
Offline

Joined: Fri Feb 21, 2003 5:41
Posts: 43
delete


Last edited by Emil Weiss on Mon Feb 24, 2003 14:45, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 20:38 
Offline

Joined: Fri Feb 07, 2003 16:37
Posts: 60
Location: SaNT QUiRZe, ||*|| CaTaLoNiA ||*||
Emil what module do you want ??

For Visual Basic 6 or Visual Basic .NET ¿?

This night or tomorrow , i will send you the module ok ¿?

Nice screenshots, what do the project ¿? What make ¿?

Bye!

_________________
Nuestra única limitación es la imaginación


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 21:50 
Offline

Joined: Fri Feb 21, 2003 5:41
Posts: 43
delete


Last edited by Emil Weiss on Mon Feb 24, 2003 14:45, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 22:09 
Offline

Joined: Fri Feb 07, 2003 16:37
Posts: 60
Location: SaNT QUiRZe, ||*|| CaTaLoNiA ||*||
Ok, but tell me, the module for Visual Basic 6 or Visual Basic .NET ¿?!¿!?

_________________
Nuestra única limitación es la imaginación


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 22:27 
Offline

Joined: Fri Feb 21, 2003 5:41
Posts: 43
delete


Last edited by Emil Weiss on Mon Feb 24, 2003 14:46, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 22:38 
Offline

Joined: Wed Feb 19, 2003 13:37
Posts: 16
Emil Weiss wrote:
Hi Marc

Please module for Visual Basic 6

verry poor my english Sorry..

Greetings Emil


Hi!

Me too Visual Basic 6 module

Thanks!

_________________
Rengas joka ei vedä, se jarruttaa - Nissan Sunny 1.6 SLX 4x4


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 21, 2003 22:46 
Offline

Joined: Fri Feb 07, 2003 16:37
Posts: 60
Location: SaNT QUiRZe, ||*|| CaTaLoNiA ||*||
Please what function you use to draw bytes (of pixels) ?¿?

Thanks

_________________
Nuestra única limitación es la imaginación


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 163 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 11  Next

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group