Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
trainee
Posts: 237
Registered: ‎05-07-2010
My Device: 8520
My Carrier: Internet

how to get thumbnail image from mp3 file?

hi,

how can i get thumbnail image from mp3 files.

 

as i know we  can get meta information from mp3 files.

 

thankx

___________________________________________________
please press kudos(star button on left) if this post is helpful to you
"Accept as solution" if your query has been resolved.@hitendra
_________________________________________________
Please use plain text.
Developer
nitinverma274
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: how to get thumbnail image from mp3 file?

I get the thumbnail for Image from this code,

 

Hope, this will Help you.

 

private Image createThumbnail(Image image) {
int sourceWidth = image.getWidth();
int sourceHeight = image.getHeight();
 
int thumbWidth = 64;
int thumbHeight = -1;
 
if (thumbHeight == -1)
thumbHeight = thumbWidth * sourceHeight / sourceWidth;
 
Image thumb = Image.createImage(thumbWidth, thumbHeight);
Graphics g = thumb.getGraphics();
 
for (int y = 0; y < thumbHeight; y++) {
for (int x = 0; x < thumbWidth; x++) {
g.setClip(x, y, 1, 1);
int dx = x * sourceWidth / thumbWidth;
int dy = y * sourceHeight / thumbHeight;
g.drawImage(image, x - dx, y - dy,
Graphics.LEFT | Graphics.TOP);
}
}
 
Image immutableThumb = Image.createImage(thumb);
 
return immutableThumb;
}

------------------------------------------------------------------------------------
Press Kudo to say thank to developer.
Also Press the Accept as solution Button when u got the Solution.

 

 

 

 

 

 

 

Please use plain text.
Developer
trainee
Posts: 237
Registered: ‎05-07-2010
My Device: 8520
My Carrier: Internet

Re: how to get thumbnail image from mp3 file?

hi nitin,

you have not  understand my question properly.

 

 i am talking about image icon that is with mp3 file.

 

so i want that if there is an image icon with mp3 file how can i retrive this.

 

please visit this link.

http://en.wikipedia.org/wiki/ID3

___________________________________________________
please press kudos(star button on left) if this post is helpful to you
"Accept as solution" if your query has been resolved.@hitendra
_________________________________________________
Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: how to get thumbnail image from mp3 file?

Had to anwser this question previously:

http://supportforums.blackberry.com/t5/Java-Development/how-to-retrieve-ID3-art-Image-from-an-mp3-fi...

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.