Regarding Images
Hi
I need to show images in the column of a table on each row. I stored the image in mimes/components/package folder. But in the code , can anyone tell me the url to access the image?
Regards
Sreekar
Hi sreekar,
1) U have to store ur image inside the src/mimes/components/packages.
2) After storing the image now if u want to use it inside ur table row, append the UIelement inside the table row while creating the table.
3) Then in the properties of the image.GO to source property and then specify the name of the image with the extension.(Ex test.bmp)
4) Then if u deploy ur appln u will be able to c the image displayed in the table.
Hope it helps,
Regards,
Nagarajan.
Similar Messages
-
General Question Regarding Image Processing
Hi All,
I need a suggestion regarding image processing and this is the best place to get best advise.
we need an image processing utility for our web processing.
requirements are as described below:
we have a e commerce based application where we need to display product images which we are currently displaying successfully.
now we have to provide user with image processing functionality like user can zoom image can flip image can rotate image.
what we want like when user click on zoom we can generate a dynamic image of that region based on a single source of image and can provide zooming functionality.
more over company requirements is to go for only open source solution [:-)]
we tried some open source solutions but due to the in house E-Commerce framework constraints we not able to integrate them,.
can any one point me to any open source java based library so that we can use that to provide solution or do we need some other approach.
Here is a link for a image zooming example hough this is highly professional solution using Adobe Scene7 but we want to implement something like in image zooming
[Zoom Demo|http://s7d2.scene7.com/s7ondemand/zoom/flasht_zoom.jsp?company=S7Web&sku=AnthroISwebDemo&config=S7Web/AnthroISwebDemo&zoomwidth=500&zoomheight=500&viewer=/skins/S7Web/SWFs/loaders/genericzoomLfour.swf&vc=codeRoot%3D%2Fis-viewers351%2Fflash%2F]
any help in this regard will be much appreciated.
Thanks in advance
-UmeshIt is never safe to assume that any allocation was successful, and while it's incredibly unlikely that you're running into any such situation, it's entirely possible for a formal protocol to declare that a given message send should return immediately without waiting around:
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ch apter13_section_8.html#//appleref/doc/uid/TP30001163-CH9-BAJIGHAF
An "impression" doesn't prove much unfortunately, so I'd recommend getting friendly with the debugger to see what's really going on. -
Hello,
I m having C3 but seems one problem i.e. All the images or photos in memory card automatically shown in "Photos- My Photos".
Anything deleting from that deletes frm memory card too.
I want to show selected photos in "My Photos".
Any suggestions regarding it.See http://kb.mozillazine.org/Animated_images
-
Regarding Images save in SAP database
HI Sapers,
our client is having the business scenario like, Material will be supplied by vendor is in bulk quantity, ex. they will sent the material through transport vehicles, at the time of receiving the material from vendor the security people will needs to create a gate pass which consists of vehicle number plate image and diver image,
The material sent by vendor is against a P.O. only, we can get the all the information from SAP data base, my basic requirement is how we can save the JPEG files in to sap data base. pl provide the necessary steps of it.
Thanks in advance,
Venkat.HI,
Check the links
http://www.sap-img.com/oracle-database/how-to-save-an-image-in-a-sql-server-database.htm
http://help.sap.com/saphelp_banking463/helpdata/en/7d/f63a25015111d396480000e82de14a/content.htm
http://help.sap.com/SAPHELP_NW70EHP1/helpdata/EN/43/a996152ce41bbde10000000a1553f7/content.htm
Regards
KK
Edited by: Kishore Kumar Galla on Mar 18, 2010 11:52 AM -
Need help regarding image scanning from scanner and resizing it...
Hi,
I need help regarding scanning of image directly from scanner. Here is the scenario when the person clicks scan button on the webpage should scan the image and resize it and store it in some temp location. Is there any way i can do this. Any Help regarding this would be great!!!
Thanks,
Avinash.
Edited by: Kalakonda on Jul 24, 2009 8:08 AMKalakonda wrote:
I need help regarding scanning of image directly from scanner. Here is the scenario when the person clicks scan button on the webpage should scan the image and resize it and store it in some temp location. Is there any way i can do this. Any Help regarding this would be great!!!So what you are doing is you have a Scanner (hardware: like an HP flatbed scanner) attached to a server that you want to use as a scanning station? Is this the senario that you are talking about? -
Question regarding image and links tag
Hi. Im new to podcasting and have just had my first podcast excepted on itunes.
Im using garageband.com to store my audio file and copy & pasting the address into itunes to submit it. (http://www.garageband.com/user/wabel/podcast/main.xml)
What i dont understand is adding an cd cover image and links to a web site.
I asume its sumular to html, where you type the code with link or image, but where? I cant edit within the above link!
Please help.The "code" for images and links goes into the xml file.
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<ttl>60</ttl>
<title></title>
<link></link>
<language></language>
<copyright></copyright>
<itunes:subtitle></itunes:subtitle>
<itunes:author></itunes:author>
<itunes:summary></itunes:summary>
<itunes:owner>
<itunes:name>John Doe</itunes:name>
<itunes:email>[email protected]</itunes:email>
</itunes:owner>
<itunes:image href="http://example.com/podcasts/everything/AllAboutEverything.jpg" />
<itunes:category text=" ">
<itunes:category text=" "/>
</itunes:category>
<item>
<title></title>
<itunes:author></itunes:author>
<itunes:subtitle></itunes:subtitle>
<itunes:summary></itunes:summary>
<enclosure url=" " length=" " type=" " />
<guid></guid>
<pubDate></pubDate>
<itunes:duration></itunes:duration>
<itunes:keywords></itunes:keywords>
</item>
</channel
</rss> -
hi all,
iam trying to display an image in a JSP page.I have written the query in a servlet and calling that servlet in the img src attribute.But the image is not been displayed.Below is the code i have written.Can anyone tell me where did i go wrong .Thanx in advance.
This is the HTML page.
<html>
<body>
<form>
<img src='DisplayImage' height='400' width='400'/>
</form>
</body>
</html>This is the servlet
public class DisplayImage extends HttpServlet
public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
try
Class.forName("org.gjt.mm.mysql.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost/test","root","");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select image from imagetable");
Blob blob;
byte[] imgbytes;
if(rs.next())
imgbytes=rs.getBytes("image");
BufferedOutputStream output = null;
ByteArrayInputStream input = new ByteArrayInputStream(imgbytes);
int contentLength = input.available();
output = new BufferedOutputStream(response.getOutputStream());
while (contentLength-- > 0)
output.write(input.read());
output.flush();
catch(Exception e)
}Not enough information :)
Possible reasons include (but aren't limited to):
1) your failure to set the correct content type for the output stream
2) not writing the image data to the output stream correctly (or at all)
3) writing data that's not image data
4) having the wrong URI for the servlet -
Hi all,
From my webdynpro application i am creating a html file and attach this file as attachment while sending emails from the application.
The Image in the HTML file is not displaying when we open the email attachment. Now the image is under source-->mimes folder only. It is of type JPG. What should i do to display the image in the attachment html file.Hi
Create Context element in UIelement Interactive form inside mappednode like ImageURL.
Write the code in Init() method like this
try {
String url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getDeployableObjectPart(),"LII.bmp");
wdContext.currentZ_Ff_Ar_Invoice_Copy_InputElement().setInvoiceUrl(url);
catch(Exception e)
throw new WDRuntimeException(e);
This might helps you
Thanks
Lohi. -
Regarding image uploading in alv
hi ,
how to pass logo in REUSE_ALV_COMMENTARY_WRITEhi,
try this code for better understanding
TABLES DECLARATIONS *
TABLES: vbap.
DATA DECLARATIONS *
DATA: v_flag,
v_data(50).
INTERNAL TABLES DECLARATIONS *
DATA: BEGIN OF it_final OCCURS 0,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
audat LIKE vbak-audat,
netwr LIKE vbak-netwr,
dummy LIKE icon-id, "for displaying icon
color(3), "for applying color
END OF it_final.
TYPE DECLARATIONS FOR ALV *
TYPE-POOLS : slis.
*Type Declarations for Field Catalog
DATA : i_fldcat_head TYPE slis_t_fieldcat_alv,
wa_fldcat_head TYPE slis_fieldcat_alv.
*Type Declarations for ALV Events
DATA : i_events TYPE slis_t_event,
wa_event LIKE LINE OF i_events.
*Type Declarations for Layout Design
DATA : wa_layout TYPE slis_layout_alv.
*Type Declarations for Sorting Fields
DATA: it_sort TYPE slis_sortinfo_alv OCCURS 0 WITH HEADER LINE.
DATA: LIST_HEADER TYPE SLIS_T_LISTHEADER.
*Type Declarations for Displaying Images on Grid
DATA : i_comment TYPE slis_t_listheader,
wa_comment TYPE slis_listheader.
*Type Declarations for Grouping fields
DATA : wa_group TYPE slis_sp_group_alv,
i_group TYPE slis_t_sp_group_alv.
SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_vbeln FOR vbap-vbeln..
SELECTION-SCREEN END OF BLOCK b1.
Event INITIALIZATION *
INITIALIZATION.
MOVE 'Developed by'(020) TO v_data.
Event AT SELECTION-SCREEN *
AT SELECTION-SCREEN ON s_vbeln.
IF NOT s_vbeln[] IS INITIAL.
PERFORM validate_vbeln.
ENDIF.
Event START-OF-SELECTION *
START-OF-SELECTION.
PERFORM get_data.
PERFORM generate_fldcat.
PERFORM generate_events.
PERFORM generate_layout.
PERFORM do_sort.
PERFORM do_group.
Event END-OF-SELECTION *
END-OF-SELECTION.
IF v_flag = 'X'.
PERFORM display_report.
ELSE.
MESSAGE 'NO DATA TO DISPLAY'(002) TYPE 'I'.
ENDIF.
*& Form GET_DATA
FORM get_data.
SELECT a~vbeln
a~posnr
b~audat
b~netwr
INTO CORRESPONDING FIELDS OF TABLE it_final
FROM vbap AS a
INNER JOIN vbak AS b
ON avbeln EQ bvbeln
WHERE a~vbeln IN s_vbeln.
IF sy-subrc EQ 0.
v_flag = 'X'.
ELSE.
v_flag = space.
ENDIF.
LOOP AT it_final.
IF it_final-netwr EQ 0.
it_final-dummy = '@0A@'.
it_final-color = 'C61'.
ELSEIF it_final-netwr GT 0 AND it_final-netwr LE 100.
it_final-dummy = '@09@'.
it_final-color = 'C71'..
ELSEIF it_final-netwr GT 100.
it_final-dummy = '@08@'.
it_final-color = 'C51'.
ENDIF.
MODIFY it_final INDEX sy-tabix.
ENDLOOP.
ENDFORM. " GET_DATA
*& Form DISPLAY_REPORT
FORM display_report.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = I_STRUCTURE_NAME
i_background_id = 'ENJOYSAP_LOGO'
I_GRID_TITLE = I_GRID_TITLE
I_GRID_SETTINGS = I_GRID_SETTINGS
is_layout = wa_layout
it_fieldcat = i_fldcat_head
IT_EXCLUDING = IT_EXCLUDING
it_special_groups = i_group
it_sort = it_sort[]
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
it_events = i_events
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS = IT_ALV_GRAPHICS
IT_HYPERLINK = IT_HYPERLINK
IT_ADD_FIELDCAT = IT_ADD_FIELDCAT
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_REPORT
*& Form generate_fldcat
FORM generate_fldcat.
wa_fldcat_head-fieldname = 'VBELN'(003).
wa_fldcat_head-col_pos = '1'.
wa_fldcat_head-just = 'C'.
wa_fldcat_head-outputlen = '10'.
wa_fldcat_head-seltext_m = 'sales document'(004).
wa_fldcat_head-ddictxt = 'S'.
APPEND wa_fldcat_head TO i_fldcat_head.
wa_fldcat_head-fieldname = 'POSNR'(005).
wa_fldcat_head-col_pos = '2'.
wa_fldcat_head-just = 'C'.
wa_fldcat_head-outputlen = '6'.
wa_fldcat_head-seltext_m = 'Sales Docu It'(006).
wa_fldcat_head-ddictxt = 'S'.
APPEND wa_fldcat_head TO i_fldcat_head.
wa_fldcat_head-fieldname = 'AUDAT'(007).
wa_fldcat_head-col_pos = '3'.
wa_fldcat_head-just = 'C'.
wa_fldcat_head-outputlen = '8'.
wa_fldcat_head-seltext_m = 'Document Date'(008).
wa_fldcat_head-ddictxt = 'S'.
APPEND wa_fldcat_head TO i_fldcat_head.
wa_fldcat_head-fieldname = 'NETWR'(009).
wa_fldcat_head-col_pos = '4'.
wa_fldcat_head-just = 'C'.
wa_fldcat_head-outputlen = '15'.
wa_fldcat_head-seltext_m = 'Net Value'(010).
wa_fldcat_head-ddictxt = 'S'.
APPEND wa_fldcat_head TO i_fldcat_head.
ENDFORM. " generate_fldcat
*& Form generate_layout
FORM generate_layout.
wa_layout-colwidth_optimize = 'X'. "OPTIMIZING FIELD WIDTH
wa_layout-zebra = 'X'. "PUTTING ZEBRA COLORS
wa_layout-confirmation_prompt = 'X'. "DISPLAYS CONFIRMATION DIALOG
wa_layout-flexible_key = 'X'. "KEY COLUMN IS MOVABLE
wa_layout-totals_text = 'Totals'(011). "DISPLAYS TOTALS TEXT
wa_layout-subtotals_text = 'Sub Totals'(012)."DISPLAYS SUB TOTALS TEXT
wa_layout-info_fieldname = 'COLOR'(013). "APPLYING COLORS TO ROWS
ENDFORM. " generate_layout
*& Form do_sort
FORM do_sort.
it_sort-fieldname = 'VBELN'(014).
it_sort-tabname = 'IT_FINAL'.
it_sort-up = 'X'.
it_sort-subtot = 'X'.
APPEND it_sort.
ENDFORM. " do_sort
*& Form generate_events
FORM generate_events.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
et_events = i_events
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF NOT i_events[] IS INITIAL.
READ TABLE i_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
wa_event-form = 'GENERATE_USERCOMMAND'.
MODIFY i_events FROM wa_event INDEX sy-tabix.
READ TABLE i_events INTO wa_event WITH KEY name = 'END_OF_LIST'.
wa_event-form = 'GENERATE_USERCOMMAND_FOOTER'.
MODIFY i_events FROM wa_event INDEX sy-tabix.
ENDIF.
ENDFORM. " generate_events
*& Form GENERATE_USERCOMMAND
Displaying Header-Text and Logo on Grid
FORM GENERATE_USERCOMMAND .
CLEAR I_COMMENT[].
WA_COMMENT-TYP = 'H'.
WA_COMMENT-INFO = 'Sales Order Information'(017).
APPEND WA_COMMENT TO I_COMMENT.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = LIST_HEADER
I_LOGO = 'ENJOYSAP_LOGO'.
I_END_OF_LIST_GRID = 'X'.
ENDFORM. " GENERATE_USERCOMMAND
*& Form GENERATE_USERCOMMAND_FOOTER
FORM GENERATE_USERCOMMAND_FOOTER .
CLEAR I_COMMENT[].
WA_COMMENT-TYP = 'S'.
WA_COMMENT-KEY = V_DATA.
WA_COMMENT-INFO = 'Fareeda Tabassum'(016).
APPEND WA_COMMENT TO I_COMMENT.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_COMMENT
I_LOGO = ''
I_END_OF_LIST_GRID = 'X'.
ENDFORM. " GENERATE_USERCOMMAND_FOOTER
*& Form GENERATE_USERCOMMAND
Displaying Header-Text and Logo on Grid
FORM GENERATE_USERCOMMAND1.
CLEAR I_COMMENT[].
WA_COMMENT-TYP = 'H'.
WA_COMMENT-INFO = 'Sales Order Information'(017).
APPEND WA_COMMENT TO I_COMMENT.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = 'i_comment'.
I_LOGO = 'ENJOYSAP_LOGO'.
I_END_OF_LIST_GRID = 'X'.
ENDFORM. " GENERATE_USERCOMMAND
*& Form do_group
FORM do_group.
CLEAR i_group.
wa_group-sp_group = 'A'.
wa_group-text = 'NETWR'.
APPEND wa_group TO i_group.
ENDFORM. " do_group
*& Form validate_vbeln
FORM validate_vbeln.
SELECT VBELN UP TO 1 ROWS
INTO (VBAP-VBELN)
FROM VBAP
WHERE VBELN IN S_VBELN.
ENDSELECT.
IF SY-SUBRC NE 0.
MESSAGE 'Invalid Range of Material'(015) TYPE 'I'.
ENDIF.
ENDFORM. " validate_vbeln
to see logos goto-se78 and just copy the logo whtever u want ant paste at commentey write (parameter---logo) in single cots . reward points if useful to u. ook thansks and have a nice day -
I am trying to build an application that sends an image by transforming it into a byte array. My problem is that, when I receive the byte array, I want to save it as a file on the mobile phone. Can someone suggest me a way of solving this, please?
jsr-75 is optional, but you can very easily store your byte[] image in the RMS (record store). See:
http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/rms/RecordStore.html -
Image processing Manupulation problem!!!
Dear all,
God Morning! hope u all are fine .. i have an issue regarding Image processing Manipulation.
i want to give u all the details.. what i have done so far in java.
i have used third party tool of java called ImageJ editor for image manipulation.i got the source of it i have made neccessary customization to store / fetch the image from my table (Database).now this editor is working fine when i click on open option from menu bar it fetches the image from database and after fetching it put the image on container where one can edit/ modify the image and save it back to the table.
the above proceeds me to display or store the edited image on the database . now i just want to integrate the editor on browser ..
how to call the class file when i click on the link on specified page and also how to pass parameter from jsp page to java class file.??
please help me to sort out d problem
"Thanks and regards"
JontyIncreasing the contrast springs to mind.
When used to extremes it is sometimes called
'cartoonising'
Suppose your image was in 16 colors, you could
reasonably safely assume at least two are red, two
are blue, two are yellow ect.
With regards an algorithm you are looking to 'round
off' the color values to (my suggestion only) the
nearest 64 or even the nearest 127...
Bamkinjust be careful of that ORANGE color. Orange is a tricky color to define in either RGB or HSB, and is very similar to red and yellow. A little change in either direction makes it difficult to distinguish from one or the other.
my thought would be to try to force your image to only six colors. Then those colors (it wouldn't really matter if they were accurate, as long as they are correctly distinguished) would be easy to identify.
- Adam -
How do I release memory when done with a large Image?
I've got a sample program here. Enter a filename of a .jpg file, click the button and it will load and display a thumbnail of it. However memory is not released so repeatedly clicking the button will let you watch the memory use grow and grow. What should be done in the code to release the large original image once the thumbnail is obtained? Here's the class:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.util.Iterator;
import javax.imageio.*;
import javax.imageio.stream.*;
import javax.swing.*;
public class ImageMemoryLeak extends JFrame implements ActionListener {
private JLabel thumbnail = null;
private JTextField tf = null;
private JButton button = null;
public static void main(String[] args) {
ImageMemoryLeak leaker = new ImageMemoryLeak();
try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }
catch (Exception ex) { }
leaker.showDialog();
private void showDialog() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100,100,200,200);
setBackground(new Color(255,255,255));
Container cont = getContentPane();
cont.setBackground(Color.lightGray);
cont.setLayout(new FlowLayout());
thumbnail = new JLabel("thumbnail here");
cont.add(thumbnail);
tf = new JTextField("type filename here");
cont.add(tf);
button = new JButton("Load Image");
button.addActionListener(this);
cont.add(button);
pack();
setVisible(true);
public void actionPerformed(ActionEvent e) {
if (e.getSource() == button) {
String fname = tf.getText();
File f = new File(fname);
if (f.exists()) {
try {
// This is where a file is loaded and thumbnail created
Iterator<ImageReader> iter = ImageIO.getImageReadersByFormatName("jpeg");
ImageReader imgrdr = iter.next();
ImageInputStream iis = ImageIO.createImageInputStream(f);
imgrdr.setInput(iis, true);
ImageReadParam param = imgrdr.getDefaultReadParam();
BufferedImage fullSizeImage = imgrdr.read(0, param);
imgrdr.dispose(); // is this enough?
iis.close();
int thWidth = 150;
int thHeight = 150;
int w = fullSizeImage.getWidth(null);
int h = fullSizeImage.getHeight(null);
double ratio = (double)w/(double)h;
if (w>h) thHeight = (int)((double)thHeight /ratio);
else if (w<h) thWidth = (int)((double)thWidth * ratio);
BufferedImage thumbImage = new BufferedImage(thWidth, thHeight, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D = thumbImage.createGraphics();
graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
graphics2D.drawImage(fullSizeImage, 0, 0, thWidth, thHeight, null);
// done with fullSizeImage now - how to release it though?
fullSizeImage.flush(); // doesn't seem to do the trick
ImageIcon oldicon = (ImageIcon)thumbnail.getIcon();
if (oldicon != null) oldicon.getImage().flush();
ImageIcon icon = new ImageIcon(thumbImage);
thumbnail.setIcon(icon);
thumbnail.setText("");
pack();
} catch (IOException e1) {
e1.printStackTrace();
else {
thumbnail.setText("file not found");
}lecisco wrote:
AndrewThompson64 wrote:
lecisco wrote:
I don't mind having GC getting to it but it's not doing so now. .. Isn't it? GC is only called when the JRE feels it is necessary. Definitive evidence of a memory leak is generally revealed by an OutOfMemoryError. Does the code throw OOMEs?Excellent point. I tried loading over and over to force an OOME. I found that after the memory footprint grew to about 750mb, it reset down to about 130mb again, so it seems that GC does eventually kick in. Perhaps what I have is fine.
That question brings me to the code sample. Typing an image file name in a text field is soooo 1980s. It would take a long time and much hard work on the part of the person testing it, in order to get to an OOME.In my actual application I'm using drag-and-drop to specify the image. The text field was just to simplify the code sample. How you get the file location is not relevant for the question - it's how the resources are released. If you're saying my code is fine regarding and shouldn't be holding onto any resources, that's great. I'm not saying that. So far I've not looked closely at the code, and am no expert on resource caching in any case.
..I am looking to confirm I'm following best practices regarding image resources.Good show. There is too much rubbish code out there.
..With the code sample, you just have to specify one .jpg file and repeatedly click the button to see the memory grow, so there's no burden to type a new file each time.Oh right, my bad. I had presumed it required a different image each time. Still (grumbles) a file chooser to select the image file would not have gone astray - for us lazy types. ;) -
How to get a single particle image after particle analysis in vision development toolkit
Hi all,
After a long time I am here again to find out some solutions regarding image processing. I have an RGB image with a number of particles in it. For processing I have made it binary image and then particle analysis function is used. It is showing all the required measurements of each particles. But as well as I also need the image of each particle individually, that may be in an array so that I can get those one by one using for loop. Is it possible to do? I have no idea how to do it. Please help.Hello,
Normal recovery which you are doing, examines the content
of the environment's log files and uses this information
to ensure that your database files are consistent relative
to the information contained in the log files. Normal recovery
starts with any logs used by any transactions active at the
time of the last checkpoint, and examines all logs from then
to the current logs. Normal recovery also recreates your
environment's region files. This has the desired effect of
clearing any unreleased locks that your application may have
held at the time of an unclean application shutdown.
You can turn on verbose error messaging as that should
provide additional information on what is causing the
Invalid argument error.
For that take a look at:
DB_ENV->set_errfile
http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_set_errfile.html
Please post any additional messaging from that.
It that sheds no light on the problem, please post a
small, stand-alone test case which reproduces the problem
and I can take a further look.
Thanks,
Sandra -
How to get coordinates of a ROI in an image in Labview
Hi,
I have a question regarding image processing in NI-IMAQ. I have
Ni-IMAQ module available, soon I may acquire NI-Vision too. I have an
image file and I would like to draw a rectangle as Region of Interest
(ROI) and be able to get the coordinates of the pixels in the ROI or
along the edges of the ROI. I tried to find vis for this operation. I
was able to find vis which provides the pixel values but I could not
find the vis for the above operation. Any information regarding
solution to above problem or any good resources for learning Labview
and NI-IMAQ will be appreciated.
Thanks,
Ravi.Hello Ravi,
Thank you for using our discussion forums. We can extract the ROI by using the two IMAQ functions "IMAQ Select Rectangle" and "IMAQ Extract". From there we can get the ROI coordinates using a property node from the extracted image. Also, here are some examples regarding ROI manipulation that you might find helpful.
http://zone.ni.com/devzone/cda/epd/p/id/1239
http://zone.ni.com/devzone/cda/tut/p/id/2887
Regards,
Vu D
Applications Engineer -
Image upload/retrieve turorial not working
The tutorial regarding image upload retrieval in the following link is not working:
http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/2/retrieve_binary_data.html
I get the following error:
Java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.security.PrivilegedActionException : Error opening socket to server localhost on port 21527 with message : null
ThanksHi Sakthi,
Finally I managed to make it work with the following modifications:
(1) In the servlet jdbc/Order> jdbc/Travel
(2) The datasource names for the rowsets in the session as Travel (instead of Order)
Another observation I made is: If you bind the url of the image component (which is on the datatable column) to a (for example applicationbean) property which retruns the necessary url, it is very convinent to handle the datatable layout visually. (Otherwise if you go to the datatable layout it shows some error message popup)
Thanks.
Maybe you are looking for
-
Weird open command stuck under menu bar for just one specific file
I'm having a weird problem where a little arrow in a small grey box sits under the menu bar, no matter which program is active. If I roll over it, an icon for a quicktime file shows. Clicking it open a specific file. It's one I had dragged to the des
-
Unable to update payment information
Due to the recent Adobe security breach, I like many other people have been forced to replace our credit cards. I received my new card and am completely unable to update my payment information. All attempts to update the information using Firefox, Ch
-
Does not happen all the time. Many time works no problems. When having problems seems to be that way for a while not just one email. Just did an email and wheel was spinning and trying to send. "Can't log on to server" I believe is what comes up. Hit
-
.jsp deployment in orabpel
In 10.1.2 we had a .jsp page as an attachment to the Human task workflow. We deployed it when we run from the BPEL console it says no page found error. We are trying to do the deployment in 10.1.3. Please could someone give me the steps for attaching
-
Hi, I had a problem which the majority of got sorted out with help from other people but it's left me with one last part i dont get... I have a main.swf which loads into a loader an external swf called menu1.swf. I'm trying to get a function triggere