Is it possible to read pixels of gif in java
Does anyone know about gif files and reading them?
If you have a gif file and there are blue dots on the gif file. What do you do to check to see if a pixel is a certain color/attribute, ie blue... ? Please give code only - many other posts are general and obvious -. No acme.
Load the Image with Toolkit and MediaTracker,
create BufferedImage: BufferedImage image = new BufferedImage(loadedImage.getWidth(null),loadedImage.getHeight(null), BufferedImage.TYPE_...);
Then get the image's Raster: Raster raster = image.getRaster();
Now read pixels: raster.getPixel(x,y, intArray)
where intArray is to receive the sample values of the pixel (with ARGB 4 values ...)
Look at Core Java, Vol II
Similar Messages
-
Possible to read/ write word files using Java?
I'm planning to write a Java application that can read an MS word document, extract something (including mathematics equations created with the equation editor) from the document and write it to another word document.
Is it possible to do this?
Can anyone give me some idea?
Any idea is much appreciated :)I think I may have misunderstood your question, but in case I didn't and you find this helpful, following is the code to read a word doc, replace certain strings, then write it out as a new doc.
import java.io.*;
public class Copy {
public static String endResult;
public static void main(String[] args) {
String oldAuthor = "Samuel Foote";
String newAuthor = "New Author";
String oldDate = "1720-1777";
String newDate = "1975 -- ";
try {
File inputFile = new File("C:\\document.doc");
BufferedReader input = null;
input = new BufferedReader(new FileReader(inputFile));
StringBuffer contents = new StringBuffer();
String line = null;
while ((line = input.readLine()) != null){
contents.append(line);
contents.append(System.getProperty("line.separator"));
String text = contents.toString();
// Replace the author and the dates
Copy y = new Copy();
y.replace(text, oldAuthor, newAuthor);
text = endResult;
y.replace(text, oldDate, newDate);
// Copy the new, improved text to another file //
Copy z = new Copy();
z.finalReplace(text);
input.close();
catch (FileNotFoundException ex) {
ex.printStackTrace();
catch (IOException ex){
ex.printStackTrace();
String replace(String text, String oldSubstring, String newSubstring) {
// Search the text for a string, then replace it //
int fromIndex = 0;
int e = 0;
StringBuffer sb = new StringBuffer();
while ((e = text.indexOf(oldSubstring, fromIndex)) >= 0) {
sb.append(text.substring(fromIndex, e));
sb.append(newSubstring);
fromIndex = e + oldSubstring.length();
sb.append(text.substring(fromIndex));
endResult = sb.toString();
System.out.println("final string = " + sb);
return sb.toString();
String finalReplace (String args) throws IOException {
// Move the altered text to a new file //
File outputFile = new File("C:\\copied document.doc");
FileWriter out = new FileWriter(outputFile);
Writer output = null;
try {
output = new BufferedWriter(new FileWriter(outputFile));
output.write(endResult);
finally {
if (output != null) output.close();
return endResult; -
Generating Animated GIF in java is it possible
Hi,
I have worked on generating GIF / JPG Files in java. Now that i would like to know if its possible to create animated GIF in java. I have'nt got any examples on that. If anyone has any, can you pl post them here?This is an animated gif encoder : http://jmge.net/java/gifenc/
Animated GIF Example :
import net.jmge.gif.Gif89Encoder;
void writeAnimatedGIF(Image[] still_images,
String annotation,
boolean looped,
double frames_per_second,
OutputStream out) throws IOException
Gif89Encoder gifenc = new Gif89Encoder();
for (int i = 0; i < still_images.length; )
gifenc.addFrame(still_images);
gifenc.setComments(annotation);
gifenc.setLoopCount(looped ? 0 : 1);
gifenc.setUniformDelay((int) Math.round(100 / frames_per_second));
gifenc.encode(out); -
I have an external hard drive, from Iomega. that I can open and see my files. However, I cannot copy or save any file to it. On my PC I have it says that is possible to read and write in it, but in my Mac, it says I can only read. can somebody help me?
Also, Im a photographer, so I like to name a lot of files at the same time (used to do in on PC and it was very usefull.) cannot find out how to do it on my Mac. Really appretiate if some one can give me a solution! ThanxYour drive is formatted with the NTFS file system. OS X can read but not write to the NTFS file system. There are third party drivers available that claim to add the ability to OS X to write to an NTFS partition. I have not tried them and don't know if they work.
The only file system that OS X and Windows can both write to natively is the FAT32 file system. -
Sychronisation AD - OID: Is it possible to read the user password from AD?
Hi.
We are using the Oracle Internet Directory shipped with the Oracle 9i Database Rel. 2 (9.2.0.1).
I try to synchronise the user accounts from AD to OID using JAVA JNDI. I'm able to read all necessary user information except the user password (MD5 value). Even if I connect to the AD using SSL, it's not possible to read the attribute userPassword.
Is anybody out there who got this work or knows a way (may also be by the use of another programming language or tool) to get the user password out of AD? Is this possible? How does the Oracle Integration Agents accomplish this?
Thanks in advance.
Hermann S.Hermann,
I am working with this as well, though from AS10g, not RDBMS. According to the OID Administrator Guide chapter 43, page 43-52:
<snip>
Synchronizing passwords from Microsoft Active Directory to Oracle Internet Directory is not possible in the Oracle Application Server 10g release because passwords in Microsoft Active Directory are not accessible by LDAP clients. However, if a deployment requires passwords to be available in Oracle Internet Directory, then the following two methods are recommended:
Build a custom plug-in for Microsoft Active Directory that captures a password change and synchronizes it with Oracle Internet Directory
Manage Active Directory passwords from the Oracle environment. This enables passwords to be available in both Oracle Internet Directory and Microsoft Active Directory because the Active Directory connector can synchronize passwords from Oracle Internet Directory to Microsoft Active Directory.
</snip>
As10g can however look up the password in AD using the "Active Directory External Authentication Plug-In". This is documented in the same chapter.
Hope this helps,
Jens -
Possible to read data from a web browser into java?
Is it possible to read data from a web browser such as IE or Mozilla into a java applet for use and manipulation? If it is, could someone please post some documentation I could look at or a snip-it of code I could use? Thanks.
This will read the content from a site:
import java.net.*;
import java.io.*;
class Test {
public static void main(String[] argv) throws Exception {
URL u = new URL("http://www.google.com");
URLConnection uc = u.openConnection();
BufferedReader br = new BufferedReader(new InputStreamReader(uc.getInputStream()));
String text;
while( (text = br.readLine()) != null ) {
System.out.println(text);
} -
Is it possible to read Idocs from SAP R/3 System?
Is it possible to read Idocs from SAP R/3 System? Instead of the aRFC
Unless Hydra emulates ECC sending IDOCS, then you just might want to use the WSMessageListener (http://help.sap.com/saphelp_xmii120/helpdata/en/45/6a86ac88130dece10000000a11466f/frameset.htm) and configure your message processing rules accordingly.
-
Possible Sequential Read Access for a Sorted Table
Hi All,
I have the following warnings in Code inspector check.
'Possible Sequential Read Access for a Sorted Table'
Kindly provide me the solution to overcome this warning message.
This is my code in BAdi : CRM_ORDER_FIELDCHECK , Method : FIELDCHECK
I am getting the above warning at
READ TABLE lt_status INTO ls_status WITH KEY status = 'E0001'
user_stat_proc = 'ZITRHDQT'
object_type = 'BUS2000114'.
and at
MODIFY ct_input_field_names FROM ls_input_field_names
TRANSPORTING changeable
WHERE fieldname NE lv_field.
Please see the below code .
DATA : lt_header_guid TYPE crmt_object_guid_tab,
lt_item_guid TYPE crmt_object_guid_tab,
lt_order_i TYPE crmt_orderadm_i_wrkt,
ls_order_i LIKE LINE OF lt_order_i,
lt_status TYPE crmt_status_wrkt,
ls_status LIKE LINE OF lt_status,
ls_input_field_names TYPE crmt_input_field_names.
DATA : lv_header_guid TYPE crmt_fieldcheck_com-guid,
lv_chng_no TYPE c VALUE 'A',
lv_field(10) TYPE c VALUE 'ACT_STATUS'.
DATA: lv_status_completed TYPE crmt_boolean.
To Get GUID
IF is_fieldcheck_com-guid IS NOT INITIAL.
lv_header_guid = is_fieldcheck_com-guid.
ELSE.
lv_header_guid = is_fieldcheck_com-ref_guid.
ENDIF.
IF is_fieldcheck_com-ref_kind EQ 'A'.
INSERT lv_header_guid INTO TABLE lt_header_guid.
ELSE.
SELECT SINGLE header FROM crmd_orderadm_i INTO lv_header_guid
WHERE guid = is_fieldcheck_com-ref_guid.
INSERT lv_header_guid INTO TABLE lt_header_guid.
ENDIF.
*To Get the required details
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = lt_header_guid
IMPORTING
et_status = lt_status
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE lt_status INTO ls_status WITH KEY status = 'E0001'
user_stat_proc = 'ZITRHDQT'
object_type = 'BUS2000114'.
IF sy-subrc = 0.
ls_input_field_names-changeable = lv_chng_no.
MODIFY ct_input_field_names FROM ls_input_field_names
TRANSPORTING changeable
WHERE fieldname NE lv_field.
ENDIF.
ENDMETHOD.
Regards
VenkatHello Blake,
Try this:
READ TABLE lt_action_fld WITH KEY STATUS = '0' BINARY SEARCH.
wf_index = sy-tabix.
loop at lt_action_fld from wf_index.
if lt_action_fld-status ne '0'.
exit.
endif.
delete lt_action_fld index wf_index.
endloop.
Let us know, if this helps.
Rgds,
Raghu. -
Is it possible to read digital data using an external clock (PCI-6259 M)?
I’m using a NI PCI-6259 M Series card and trying to write my program in VC++6.0 using the functions in the DAQmx driver.
Question1: Not all functions listed in the NI-DAQmx C Reference Help seems to be supported by my NI-card, where can I find information about which of the functions that are supported?
Question2: I want to read data from a device that clock out data on the falling edge of a clock signal. The clock signal and the data signal are routed to two DIO terminals on the NI-card. The question is if it is possible to read data using the clock as a sample clock? See two code examples below that doesn’t work. In both cases 10 samples are read at once, even if the external clock is not present.
Example 1
// Create tasks
Status = DAQmxCreateTask("", &m_ReadTrimTask);
// Set up read task
status = DAQmxCreateDIChan(m_ReadTrimTask, "Dev1/port2/line0", "", DAQmx_Val_ChanPerLine);
status = DAQmxCfgChangeDetectionTiming(m_ReadTrimTask,"Dev1/port2/line6","Dev1/port2/line6",DAQmx_Val_FiniteSamps, 10);
// Read data
int32 sampsPerChanRead, numBytesPerSamp;
status = DAQmxReadDigitalLines(m_ReadTrimTask, 10, 10.0, DAQmx_Val_GroupByChannel, result, 10, &sampsPerChanRead, &numBytesPerSamp ,NULL);
Example 2
// Create tasks
Status = DAQmxCreateTask("", &m_ReadTrimTask);
// Set up read task
status = DAQmxCreateDIChan(m_ReadTrimTask, "Dev1/port2/line0", "", DAQmx_Val_ChanPerLine);
status = DAQmxSetSampTimingType(m_ReadTrimTask, DAQmx_Val_SampClk);
status = DAQmxSetSampClkRate(m_ReadTrimTask, 1000.0);
status = DAQmxSetSampClkActiveEdge(m_ReadTrimTask, DAQmx_Val_Falling);
status = DAQmxSetSampClkSrc(m_ReadTrimTask, " Dev1/port2/line6");
// Read data
int32 sampsPerChanRead, numBytesPerSamp;
status = DAQmxReadDigitalLines(m_ReadTrimTask, 10, 10.0, DAQmx_Val_GroupByChannel, result, 10, &sampsPerChanRead, &numBytesPerSamp ,NULL);Hello Magnus,
Thank you for contacting National Instruments.
"Question1: Not all functions listed in the NI-DAQmx C Reference Help seems to be supported by my NI-card, where can I find information about which of the functions that are supported?"
The best place to look for this information would be the M Series Help Manual. There you can find the features of your PCI-6259 and what operations it supports.
"Question2: I want to read data from a device that clock out data on the falling edge of a clock signal. The clock signal and the data signal are routed to two DIO terminals on the NI-card. The question is if it is possible to read data using the clock as a sample clock? See two code examples below that doesn’t work. In both cases 10 samples are read at once, even if the external clock is not present."
Look at the "ContReadDigChan-ExtClk_Fn.c" example project which ships with the NI-DAQ driver. This is located at: C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Read Values\Cont Read Dig Chan-Ext Clk.
You will have to make some minor modifications to convert this to a finite acquisition, but that is simply a matter of changing the "sampleMode" parameter of the DAQmxCfgSampClkTiming() function. You will also have to route your clock signal to a PFI line and specify which line in your code.
I hope this helps.
Sean C.
Applications Engineering
National Instruments -
Is it possible to read archive files outside of SAP?
Hi Experts,
I would like to read SAP archived data (*.ARCHIVE.ARCHIVING) with non-SAP application. I already know, that data is automatically compressed (and maybe encrypted?).
My question: Is there some possibility to read archive files outside of SAP? I suppose that would be needed to do some decompress first.
Your help is appreciated. Thank you!
JanHi Stefan,
Thanks for your reply. I found some points with your hint. Some summary for others:
460620 - Migrating archive files:
"Archived data may have to be migrated. One solution is to perform an SLO service archive migration. You can also perform an archive migration for archive files using the Archive Development Kit (ADK)."
153433 - Access to archived data from other logical systems
"For data security reasons, the ADK checks whether an archive file was created in the same system and client where it is to be read. If the client, system or file key do no longer correspond to the meta data that were valid at the time of archiving, you can no longer always access the archive file, particularly for reloading. If only the system ID changes when a new installation due to a system copy is carried out, read accesses are still possible. No solution is provided in the standard system. The access to archive files from other logical systems must be taken into account and carried out in a migration project."
Unfortunately, I still do not know if it is possible to read archived data outside of SAP.
Best Regards,
Jan -
Is it possible to read the file using File Adapter which is in client machi
Is it possible to read the file using file Adapter which is in client machine(on the same network).Then what is thee need of FTP Adapter?
You can achieve that by exposing your client machine as a drive, then you can go using file adapter.
FTP adapter will help you to communicate with different machine which is in different network.
It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
Thanks,
Vijay -
1.is it possible to read a .xls file and load it into an oracle table
1.is it possible to read a .xls file and load it into an oracle table, using oracle database or oracle forms i.e. either utl_file, or text_io, or any other oracle tool.
As far as I know we need a csv file or a txt ( tab delimited) file ?
2.Are there any windows tools for the sameHi,
If you want to use the DDE package to read the XLS file then yes, you will neeed to know the number of rows and columns in the input file.
i.e. How will you know :
1) How many columns are there in the input file.
If I have a XLS file with the following data :
R1C1 R1C2 R1C3 R1C4 R1C5 R1C6 R1C7
xxx xx x
Where R represents row and C represents column, then how will you know the each row has 7 columns. If you know the answer upfront, then it's not a issue.
Using the DDE apprach, you will have to specify the RowNum and the ColumnNo of each idividual cells to read/write data from xls sheet.
Look at the syntax in my ealier post.
using the other approch (i.e. comma delimited text file - CSV file) , you need not know the number of columns as you can loop thru the input record till the last column is read.
All you have to do is to look for the 'n' occurances of the field delimiter say ',', do a substr from the current position to the point where the ',' was found.
This process is to be repeated in a loop till all columns are read.
The TEXT_IO package can trap for EOF (End Of File).
Hope I made myself clear.
-- Shailender Mehta -- -
I was wondering if it's at all possible to read the description of videos that you have on your iPod Touch 4th or 5th Generation. It's available on iTunes, but I was wondering if there was a way to see it on your actual device.
Any answer would be a great help! ThanksYou can omit the title altogether in the URL (together with the succeeding slash, of course). For example, my own podcast URL in the Store is
https://itunes.apple.com/gb/podcast/the-sound-of-78s/id166389425?mt=2
but this works perfectly well:
https://itunes.apple.com/podcast/id166389425
Indeed you can even put your own title:
https://itunes.apple.com/podcast/any_old_title/id166389425
So it's as simple as that! -
Is it possible to read the backups of my iPod's ipad documents on my win7 computer?
Is it possible to read the backups of my iPod's ipad documents on my win7 computer? I guess I am looking for a backup document reader/editor
And is it possible to remove or add text documents to the ipad's documents without emailing them and cut and pasting them in?- Note some of those can get them from the iPod as well as the iPod backup that iTunes makes
How to perform iPad recovery for photos, videos
Wondershare Dr.Fone for iOS: iPhone Data Recovery - Wondershare Official
http://www.amacsoft.com/ipod-data-recovery.html
iPod recovery software to restore lost music files
- For the second questin it depends upo what ap y ae using. If you are using Pages thengot to icloud.com, log in and go to Pages Beta -
Is it possible to read Prezi files within the iOS app?
Hello,
I want to implement Prezi into my iOS app. I am totally unaware that "Is it possible to read Prezi files within the iOS app?".
If Yes, please provide some tutorial link, so that I can implement into my application.
Thanks & regard.You will get a better answer in
Developer Forums
Use your Developer credentials to log in there.
Maybe you are looking for
-
ID not working in App store only. Anyone having this issue?
-
I have a powerbook G4 and iforgot my password and want to update OSX
I have a Powerbook G4 and I want to upgrade my OSX but forgot the password. I haven't used it since I bought the computer 4 years or so ago.
-
Has anyone seen this library alert
hey, I just moved my library to a second internal drive. eversince i did this, after importing from camera and restarting Aperture, I get this message : "Library Alert The following new or unknown items have been found in the library: projects: name/
-
Upload plan values using excel file
Hi Expert, I am trying to use the t-code 7KEX to upload excel spreadsheet to SAP instead of using 7KE1. However, the field "File descriptions", what do I need to indicate ? How do I create a excel file format for the upload ? I want to upload budgete
-
Univers Designer : JZ0C1, IOException closed the connection
Hi ! We get a very strange error when we work in Univers Designer (we're in BO 4.1) when we're working with Derived Table. For some reason when we edit a Derived table in a universe (connected to a Sybase database), we received an error message "JZ0C