I know how to retrieve the mime-type, the picture type, the description and the picture data. But how can i paint the picture ? I tried to save the data to a file, but it doesn't work...
Thanks in advance for any help.
Printable View
I know how to retrieve the mime-type, the picture type, the description and the picture data. But how can i paint the picture ? I tried to save the data to a file, but it doesn't work...
Thanks in advance for any help.
To paint a picture use PaintPicture method.
I don't think that would be of much help... since the information he has might not be compatible with PaintPicture.Quote:
Originally posted by IROY55
To paint a picture use PaintPicture method.
Paste all the info in a file and try to rename it to .jpg, or .gif (I guess that would be the target types) and see if any Image Viewer can open it. That could give us a clue about the type of the fiel we're dealing with.
He asked a specific question: how to paint a puicture? I gave him an answer. So I am not sure why would you say that it "wouldn't be of much help... "
Simple:Quote:
Originally posted by IROY55
He asked a specific question: how to paint a puicture? I gave him an answer. So I am not sure why would you say that it "wouldn't be of much help... "
I guess MP3 files would save the image in a compress format like JPG or even GIF. None of those extension would be suitable for PaintPicture. You might need to convert them before trying to use it.Quote:
PaintPicture Method
Draws the contents of a graphics file (.bmp, .wmf, .emf, .cur, .ico, or .dib) on a Form, PictureBox, or Printer. Doesn't supportnamed arguments.
Syntax
object.PaintPicture picture, x1, y1, width1, height1, x2, y2, width2, height2, opcode
Ok, it seems you already have this, so... what's the type of the picture?Quote:
Originally posted by matt3011
I know how to retrieve the mime-type, the picture type....
Windows media player save it as image/bmp.
When i open the picture with psp7, i only have (bottom) part of the image. Don't know why. I make a link for my .bas
A simple comment about this:
The remark about the comments is wrong. You need 28 bytes for the comments, a Chr(0) and a byte to set the track number (so you can set the track number up to 255)VB Code:
Public Type Id3v1 'This type is standard for Title As String * 30 ' Id3 Tags Artist As String * 30 ' Although later versions Album As String * 30 ' use comments for 28 bytes sYear As String * 4 ' and they use the 2 remaining bytes for "TrackNumber"! Comments As String * 30 Genre As Byte End Type
Ok, I can see in the GetID3 function that you have this code:
VB Code:
Open "dessin.bmp" For Binary As #2 Put #2, , picture_data Close #2
Can you post a zipped copy of this file so that I can see it?
The file doesn't exists originaly. It's the file i extract from the tag. I can't post the file i exctracted from my mp3, it's too large 140ko compressed
I know that the file was extracted from it. I wanted to see if I can open it. Can you upload it to any server?
McBrain,
I think you are missing something: by using PaintPicture you may practically load any type of image as long as Picturebox supportes it. Try this:
Picture1.AutoRedraw = True
Picture1.PaintPicture LoadPicture("c:\somefile.jpg"), 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
Winrar might compressed to better. Or you can also split the file into two files.
I do can open it with psp.
Here is a link to the file :
I haven't tried it. I thought what the MSDN should be true.Quote:
Originally posted by IROY55
McBrain,
I think you are missing something: by using PaintPicture you may practically load any type of image as long as Picturebox supportes it. Try this:
Picture1.AutoRedraw = True
Picture1.PaintPicture LoadPicture("c:\somefile.jpg"), 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
Don't bet on MSDN too much
If that's the file you get you can try with Iroy's code. Actually you don't even need the PaintPicture:
VB Code:
Option Explicit Private Sub Form_Load() Picture1.AutoRedraw = True Picture1.Picture = LoadPicture("C:\dessin.bmp") End Sub
PaintPicture is very usefull when you need to resize image to fit Picturebox's size, otherwise I agree: LoadPicture will do the job.
Actually, i found that the error isn't from painting picture but, i don't retieve enough data with my function.
I tried to modify the frame size manually and i can extract the entire file and paint it.
I don't know why the frame size calculated doesn't correspond to the actual size of the frame.
I found the problem. Frame size was calculated like ID3Tag size, but it shouldn't be.
GR8!!
Is it working now?
Yes it works pretty well,
I have a lot of work to do on this bas but I thonk it is a good start
Here is my .bas