knun
asked on
Color Depth and Sent Bitmap to array (Picture Box)
Dear Expert
I Need to Decrease Color depth of Picture in pictureBox (240*128) to black & white color and sent to array in memory.
Pls Help me.
this very urgent.....
I Need to Decrease Color depth of Picture in pictureBox (240*128) to black & white color and sent to array in memory.
Pls Help me.
this very urgent.....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Very Thank rettiseert.
i will accept your answer but another question ^_^ do you know how to resize image to 240*128 ^_^
i will accept your answer but another question ^_^ do you know how to resize image to 240*128 ^_^
Dim FileName As String
FileName = "C:\1.jpg" '<---- This is the file you want to show in a 240*128 picture box
Picture1.AutoRedraw = True
Picture1.PaintPicture LoadPicture(FileName), 0, 0, Me.ScaleX(240, vbPixels, Me.ScaleMode), Me.ScaleX(128, vbPixels, Me.ScaleMode)
FileName = "C:\1.jpg" '<---- This is the file you want to show in a 240*128 picture box
Picture1.AutoRedraw = True
Picture1.PaintPicture LoadPicture(FileName), 0, 0, Me.ScaleX(240, vbPixels, Me.ScaleMode), Me.ScaleX(128, vbPixels, Me.ScaleMode)
ASKER
thank rettiseert , but i don't want to operate image to file (Harddisk) just play with it in memory
ok, in that case you can load your picture at design time in a hidden picturebox and then, in your visible picturebox use something like:
Picture1.AutoRedraw = True
Picture1.PaintPicture HiddenPictureBox.Picture, 0, 0, Me.ScaleX(240, vbPixels, Me.ScaleMode), Me.ScaleX(128, vbPixels, Me.ScaleMode)
Picture1.AutoRedraw = True
Picture1.PaintPicture HiddenPictureBox.Picture, 0, 0, Me.ScaleX(240, vbPixels, Me.ScaleMode), Me.ScaleX(128, vbPixels, Me.ScaleMode)
ASKER
Very thank rettiseert.
you help me so much.
you help me so much.
ASKER
I have Picture in Picturebox already i just need to change to black and white color depth (1 bit) , and after change to 1 bit depth sent this picture (240*128 Pixel) to array .
for read data inside and sent to LCD by my module.